Mercurial > hg > configuration
comparison tests/unit.py @ 48:84fb8ad5ba81
ensure that missing values raise the correct exception
| author | Jeff Hammel <jhammel@mozilla.com> |
|---|---|
| date | Tue, 27 Mar 2012 12:50:16 -0700 |
| parents | f09982d47b3c |
| children | 09fbc09455d4 |
comparison
equal
deleted
inserted
replaced
| 47:7abea9a6fa16 | 48:84fb8ad5ba81 |
|---|---|
| 71 | 71 |
| 72 # cleanup | 72 # cleanup |
| 73 if os.path.exists(filename): | 73 if os.path.exists(filename): |
| 74 os.remove(filename) | 74 os.remove(filename) |
| 75 | 75 |
| 76 def test_missing_values(self): | |
| 77 """ensure that Configuration raises a missing value exception""" | |
| 78 | |
| 79 example = ExampleConfiguration() | |
| 80 | |
| 81 exception = None | |
| 82 try: | |
| 83 example.parse(args=[]) | |
| 84 except Exception, exception: | |
| 85 pass | |
| 86 self.assertTrue(isinstance(exception, configuration.TypeCastException)) | |
| 87 | |
| 76 def test_required(self): | 88 def test_required(self): |
| 77 """ensure you have to have required values""" | 89 """ensure you have to have required values""" |
| 78 | 90 |
| 79 example = ExampleConfiguration() | 91 example = ExampleConfiguration() |
| 80 | 92 |
