~canonical-platform-qa/ubuntu-test-cases/memevent-nfss-data-file

« back to all changes in this revision

Viewing changes to tests/memevent/support_scripts/tests/test_nfss_result_generator.py

  • Committer: Christopher Lee
  • Date: 2014-11-04 21:32:38 UTC
  • Revision ID: chris.lee@canonical.com-20141104213238-cse5xsjtl9ge5q0h
Initial move around and addition of testing for upload/gen. script/

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from testtools import TestCase, ExpectedException
 
2
from testtools.matchers import Equals
 
3
 
 
4
from support_scripts import generate_nfss_result_file as gen_nfss
 
5
 
 
6
 
 
7
class ScriptInteractionTests(TestCase):
 
8
    """Ensure the script reacts as expected."""
 
9
    def test_parse_args_returns_source_and_destination_files(self):
 
10
        test_args = ["source", "destination"]
 
11
        self.assertThat(
 
12
            gen_nfss.parse_args(test_args),
 
13
            Equals(("source", "destination"))
 
14
        )
 
15
 
 
16
    def test_raise_on_invalid_args_doesnt_raise_with_correct_args(self):
 
17
        gen_nfss.raise_on_invalid_args(["self", "source", "destination"])
 
18
 
 
19
    def test_raise_on_invalid_args_raises_with_incorrect_args(self):
 
20
        with ExpectedException(RuntimeError):
 
21
            gen_nfss.raise_on_invalid_args([])