Mercurial > hg > configuration
comparison tests/unit.py @ 24:39f2611db9be
rename a bunch of things and begin to work on the sanity of validation
| author | Jeff Hammel <jhammel@mozilla.com> |
|---|---|
| date | Mon, 26 Mar 2012 15:46:25 -0700 |
| parents | cadc9514f60a |
| children | b39e550402ea |
comparison
equal
deleted
inserted
replaced
| 23:73e72a764c3a | 24:39f2611db9be |
|---|---|
| 11 from example import ExampleConfiguration # example configuration to test | 11 from example import ExampleConfiguration # example configuration to test |
| 12 | 12 |
| 13 # globals | 13 # globals |
| 14 here = os.path.dirname(os.path.abspath(__file__)) | 14 here = os.path.dirname(os.path.abspath(__file__)) |
| 15 | 15 |
| 16 class configurationUnitTest(unittest.TestCase): | 16 class ConfigurationUnitTest(unittest.TestCase): |
| 17 | 17 |
| 18 def test_configuration(self): | 18 def test_cli(self): |
| 19 example = ExampleConfiguration() | 19 example = ExampleConfiguration() |
| 20 | 20 |
| 21 # parse command line arguments | 21 # parse command line arguments |
| 22 options, args = example.parse(['-a', 'ts', '--develop', '-e', '/home/jhammel/bin/firefox']) | 22 options, args = example.parse(['-a', 'ts', '--develop', '-e', '/home/jhammel/bin/firefox']) |
| 23 self.assertEqual(bool(args), False) # no arguments | 23 self.assertEqual(bool(args), False) # no arguments |
| 24 self.assertEqual(options.develop, True) | 24 self.assertEqual(options.develop, True) |
| 25 self.assertEqual(options.activeTests, 'ts') | |
| 25 | 26 |
| 26 if __name__ == '__main__': | 27 if __name__ == '__main__': |
| 27 unittest.main() | 28 unittest.main() |
| 28 | 29 |
