changeset 37:a1f8dec4d4f9

we has another broken test
author Jeff Hammel <jhammel@mozilla.com>
date Tue, 27 Mar 2012 09:52:51 -0700
parents d218df4d0b4c
children 8909ae1cc4ea
files configuration/config.py tests/unit.py
diffstat 2 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/configuration/config.py	Tue Mar 27 09:40:15 2012 -0700
+++ b/configuration/config.py	Tue Mar 27 09:52:51 2012 -0700
@@ -5,6 +5,7 @@
 """
 
 import copy
+import os
 import sys
 import optparse
 
@@ -203,6 +204,8 @@
                     else:
                         required_message = "Parameter %s is required but not present" % key
                     # TODO: more specific exception
+                    # Also, this should probably raise all missing values vs
+                    # one by one
                     raise MissingValueException(required_message)
         # TODO: configuration should be locked after this is called
 
--- a/tests/unit.py	Tue Mar 27 09:40:15 2012 -0700
+++ b/tests/unit.py	Tue Mar 27 09:52:51 2012 -0700
@@ -52,12 +52,15 @@
         self.assertTrue(isinstance(json_provider, configuration.JSON))
 
         # serialize to a temporary file
-        filename = tempfile.mktemp()
+        filename = tempfile.mktemp(suffix='.json')
+        self.assertFalse(os.path.exists(filename))
         config = {'browser_path': '/home/jhammel/bin/firefox',
                   'activeTests':  ['ts']}
         example(config)
         config['test_timeout'] = 1200 # default
         self.assertEqual(config, example.config)
+        example.serialize(filename)
+        self.assertTrue(os.path.exists(filename))
         if os.path.exists(filename):
             os.remove(filename)