comparison tests/unit.py @ 42:75886253ee73

test deserialization
author Jeff Hammel <jhammel@mozilla.com>
date Tue, 27 Mar 2012 11:07:51 -0700
parents 1bd4ddf2e81d
children f09982d47b3c
comparison
equal deleted inserted replaced
41:1bd4ddf2e81d 42:75886253ee73
62 self.assertEqual(config, example.config) 62 self.assertEqual(config, example.config)
63 example.serialize(filename) 63 example.serialize(filename)
64 self.assertTrue(os.path.exists(filename)) 64 self.assertTrue(os.path.exists(filename))
65 serialized = json.loads(file(filename).read()) 65 serialized = json.loads(file(filename).read())
66 self.assertEqual(serialized, config) 66 self.assertEqual(serialized, config)
67
68 # deserialize
69 deserialized = example.deserialize(filename)
70 self.assertEqual(deserialized, config)
71
72 # cleanup
67 if os.path.exists(filename): 73 if os.path.exists(filename):
68 os.remove(filename) 74 os.remove(filename)
69 75
70 def test_required(self): 76 def test_required(self):
71 """ensure you have to have required values""" 77 """ensure you have to have required values"""