Skip to content

Commit

Permalink
Added more tests for etlTest main(). Found issues with executor and c…
Browse files Browse the repository at this point in the history
…orrected.
  • Loading branch information
Alex Meadows committed Jul 18, 2014
1 parent 13de4a9 commit 067c4f0
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions etltest/test/test_etlTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,31 +96,23 @@ def test_parser_no_args(self):
def test_parser_in_file_generation(self):
#Test if in_file generation exits appropriately.
args = self.parser.parse_args(['-f', self.in_file, '-g'])
given_result = etlTest.main(args)
expected_result = None

self.assertEqual(given_result, expected_result)
with self.assertRaises(SystemExit):
etlTest.main(args)

def test_parser_in_dir_generation(self):
#Test if in_dir generation exits appropriately.
args = self.parser.parse_args(['-d', self.in_dir, '-g'])
given_result = etlTest.main(args)
expected_result = None

self.assertEqual(given_result, expected_result)
with self.assertRaises(SystemExit):
etlTest.main(args)

def test_parser_in_file_custom_output_generation(self):
#Test if custom output generation exits appropriately.
output_loc = SettingsManager().find_setting('Locations', 'output')
args = self.parser.parse_args(['-f', self.in_file, '-g', '-o', str(output_loc)])
given_result = etlTest.main(args)
expected_result = None

self.assertEqual(given_result, expected_result)
with self.assertRaises(SystemExit):
etlTest.main(args)

def test_parser_test_execution(self):
args = self.parser.parse_args(['-e'])
given_result = etlTest.main(args)
expected_result = None

self.assertEqual(given_result, expected_result)
with self.assertRaises(SystemExit):
etlTest.main(args)

0 comments on commit 067c4f0

Please sign in to comment.