Beispiel #1
0
 def test_save_load(self):
     t = Thing()
     t.save()
     sim = TestSim(t.uuid)
     sim.x = 10
     sim.z = 'hello'
     sim.ts = [1, 2, 3, 4]
     Data.save_state(t, sim)
     new_sim = TestSim(t.uuid)
     Data.load_state(t, new_sim)
     self.assertEquals(new_sim.x, 10)
     self.assertEquals(new_sim.z, 'hello')
     self.assertEquals(new_sim.ts, [1, 2, 3, 4])
Beispiel #2
0
 def test_get_set(self):
     t = Thing()
     t.save()
     Data.set_attribute(t, 'a', 5)
     self.assertEquals(Data.get_attribute(t, 'a'), 5)
Beispiel #3
0
 def test(self):
     t = Thing()
     t.save()
     self.assertTrue(t.uuid)