diff 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
line wrap: on
line diff
--- a/tests/unit.py	Tue Mar 27 12:32:15 2012 -0700
+++ b/tests/unit.py	Tue Mar 27 12:50:16 2012 -0700
@@ -73,6 +73,18 @@
         if os.path.exists(filename):
             os.remove(filename)
 
+    def test_missing_values(self):
+        """ensure that Configuration raises a missing value exception"""
+
+        example = ExampleConfiguration()
+
+        exception = None
+        try:
+            example.parse(args=[])
+        except Exception, exception:
+            pass
+        self.assertTrue(isinstance(exception, configuration.TypeCastException))
+
     def test_required(self):
         """ensure you have to have required values"""