Mercurial > hg > configuration
comparison tests/unit.py @ 36:d218df4d0b4c
add test for missing values
| author | Jeff Hammel <jhammel@mozilla.com> |
|---|---|
| date | Tue, 27 Mar 2012 09:40:15 -0700 |
| parents | 79aca36abd9a |
| children | a1f8dec4d4f9 |
comparison
equal
deleted
inserted
replaced
| 35:321fe58a9eae | 36:d218df4d0b4c |
|---|---|
| 59 config['test_timeout'] = 1200 # default | 59 config['test_timeout'] = 1200 # default |
| 60 self.assertEqual(config, example.config) | 60 self.assertEqual(config, example.config) |
| 61 if os.path.exists(filename): | 61 if os.path.exists(filename): |
| 62 os.remove(filename) | 62 os.remove(filename) |
| 63 | 63 |
| 64 def test_required(self): | |
| 65 """ensure you have to have required values""" | |
| 66 | |
| 67 example = ExampleConfiguration() | |
| 68 | |
| 69 # ensure you get an exception | |
| 70 missingvalueexception = None | |
| 71 try: | |
| 72 example() | |
| 73 except configuration.MissingValueException, e: | |
| 74 missingvalueexception = e | |
| 75 self.assertTrue(isinstance(e, configuration.MissingValueException)) | |
| 76 | |
| 64 if __name__ == '__main__': | 77 if __name__ == '__main__': |
| 65 unittest.main() | 78 unittest.main() |
| 66 | 79 |
