# HG changeset patch # User Jeff Hammel # Date 1332802505 25200 # Node ID b39e550402eaa367ef6c6a2badf3963fe755999f # Parent 39f2611db9be30378683d5301f56d10e64ed216f we now update configuration correctly diff -r 39f2611db9be -r b39e550402ea configuration/config.py --- a/configuration/config.py Mon Mar 26 15:46:25 2012 -0700 +++ b/configuration/config.py Mon Mar 26 15:55:05 2012 -0700 @@ -131,7 +131,7 @@ # TODO: should probably deepcopy config # ensure options in configuration are in self.options - unknown_options = [i for i in config if i in self.options] + unknown_options = [i for i in config if i not in self.options] if unknown_options: # TODO: more specific error type raise Exception("Unknown options: %s" % ', '.join(unknown_options)) @@ -154,7 +154,7 @@ """add items to configuration and check it""" for config in args: self.add(config) - self.valdate() # validate total configuration + self.validate() # validate total configuration # TODO: configuration should be locked after this is called def add(self, config, check=True): diff -r 39f2611db9be -r b39e550402ea tests/unit.py --- a/tests/unit.py Mon Mar 26 15:46:25 2012 -0700 +++ b/tests/unit.py Mon Mar 26 15:55:05 2012 -0700 @@ -20,9 +20,17 @@ # parse command line arguments options, args = example.parse(['-a', 'ts', '--develop', '-e', '/home/jhammel/bin/firefox']) + + # ensure that the options appropriately get set self.assertEqual(bool(args), False) # no arguments self.assertEqual(options.develop, True) - self.assertEqual(options.activeTests, 'ts') + self.assertEqual(options.activeTests, ['ts']) + self.assertEqual(options.browser_path, '/home/jhammel/bin/firefox') + + # ensure that the configuration appropriately gets updated + self.assertEqual(example.config['develop'], True) + self.assertEqual(example.config['activeTests'], ['ts']) + self.assertEqual(example.config['browser_path'], '/home/jhammel/bin/firefox') if __name__ == '__main__': unittest.main()