Beispiel #1
0
 def test_sim_task_call(self):
     sim = Thing.create_sim(HelloRobot)
     task = Task(thing=Thing.objects.get(uuid=sim.uuid), name='hello')
     task.save()
     task2 = Task.objects.get(id=task.id)
     self.assertEquals(task2.status, 'REQUESTED')
     self.assertEquals(call_sim_task_method(sim.uuid, task.id, 'sim_task_hello'), 'Hello')
     task2 = Task.objects.get(id=task.id)
     self.assertEquals(task2.status, 'COMPLETED')
Beispiel #2
0
 def obj_create(self, bundle, request=None, **kwargs):
     bundle.obj = Thing.create_sim(self._meta.object_class)
     self.full_hydrate(bundle)
     bundle.obj.save()
     return bundle
Beispiel #3
0
 def test_sim_call(self):
     sim = Thing.create_sim(HelloRobot)
     self.assertEquals(call_sim_method(sim.uuid, 'sim_hello'), 'Hello')
Beispiel #4
0
 def test_call(self):
     sim = Thing.create_sim(HelloRobot)
     self.assertEquals(sim.sim_hello(), 'Hello')
Beispiel #5
0
 def test_create_sim(self):
     self.sim = Thing.create_sim(BaseSim)
     self.assertTrue(self.sim.uuid)
     t = Thing.objects.get(uuid=self.sim.uuid)
     self.assertEquals(t.uuid, self.sim.uuid)
Beispiel #6
0
 def create_sim(cls):
     return Thing.create_sim(cls)