diff tests/unit.py @ 65:2a2e9aee5bc6

refactor completed and tests pass again
author Jeff Hammel <jhammel@mozilla.com>
date Wed, 28 Mar 2012 08:37:01 -0700
parents f7dc5cf2540c
children 0804a706d6bf
line wrap: on
line diff
--- a/tests/unit.py	Wed Mar 28 08:33:54 2012 -0700
+++ b/tests/unit.py	Wed Mar 28 08:37:01 2012 -0700
@@ -28,7 +28,7 @@
         example = ExampleConfiguration()
 
         # parse command line arguments
-        options, args = example.parse(['-a', 'ts', '--develop', '-e', '/home/jhammel/bin/firefox'])
+        options, args = example.parse_args(['-a', 'ts', '--develop', '-e', '/home/jhammel/bin/firefox'])
 
         # ensure that the options appropriately get set
         self.assertEqual(bool(args), False) # no arguments
@@ -80,7 +80,7 @@
 
         exception = None
         try:
-            example.parse(args=[])
+            example.parse_args(args=[])
         except Exception, exception:
             pass
         self.assertTrue(isinstance(exception, configuration.MissingValueException))
@@ -111,19 +111,19 @@
 
         # parse the json file
         example = ExampleConfiguration()
-        example.parse([json_file])
+        example.parse_args([json_file])
         self.assertEqual(example.config, json_config)
 
         # parse the json file with overrides
         example = ExampleConfiguration()
-        example.parse([json_file] + args1)
+        example.parse_args([json_file] + args1)
         config = json_config.copy()
         config['browser_path'] = '/opt/bin/firefox'
         self.assertEqual(example.config, config)
 
         # it shouldn't matter in which order the arguments are
         example = ExampleConfiguration()
-        example.parse(args1 + [json_file])
+        example.parse_args(args1 + [json_file])
         self.assertEqual(example.config, config)
 
         # Now a tricky case:
@@ -134,7 +134,7 @@
         self.assertEqual(json_config['test_timeout'], 60)
         self.assertEqual(config['test_timeout'], 60)
         # but we can override it back from the "command line"
-        example.parse(args1 + [json_file, '--test_timeout', '1200'])
+        example.parse_args(args1 + [json_file, '--test_timeout', '1200'])
         config['test_timeout'] = 1200
         self.assertEqual(example.config, config)