diff 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
line wrap: on
line diff
--- a/tests/unit.py	Tue Mar 27 09:35:21 2012 -0700
+++ b/tests/unit.py	Tue Mar 27 09:40:15 2012 -0700
@@ -61,6 +61,19 @@
         if os.path.exists(filename):
             os.remove(filename)
 
+    def test_required(self):
+        """ensure you have to have required values"""
+
+        example = ExampleConfiguration()
+
+        # ensure you get an exception
+        missingvalueexception = None
+        try:
+            example()
+        except configuration.MissingValueException, e:
+            missingvalueexception = e
+        self.assertTrue(isinstance(e, configuration.MissingValueException))
+
 if __name__ == '__main__':
     unittest.main()