예제 #1
0
 def test_save(self):
     '''
     Test check that load and save processes don't modify input/output format
     '''
     import tempfile, os, json
     citymap = CityMap.loadFromString(self.json_data)
     tmpfile = tempfile.mkstemp()
     citymap.save(tmpfile[1])
     self.assertEqual(str(self.data), str(json.load(open(tmpfile[1]))))
     os.remove(tmpfile[1])
예제 #2
0
 def test_load_string(self):
     '''
     Test loading data from string format. 
     '''
     citymap = CityMap.loadFromString(self.json_data)
     self.check_load_data(citymap)