Esempio n. 1
0
 def handle():
     # first is_free
     data = unserialize(self.socket_rr.recv())
     self.assertEquals(['is_free',None,True],data)
     self.socket_rr.send(serialize([[{},{}], {}]))
     # second is free
     data = unserialize(self.socket_rr.recv())
     self.assertEquals(['is_free',None,False],data)
     self.socket_rr.send('{}')
     # result
     data = unserialize(self.socket_rr.recv())
     self.assertEquals(['solve',None,{}],data)
     self.socket_rr.send('{}')
Esempio n. 2
0
 def handle():
     self.socket_rr.recv()
     self.assertTrue(self.supervisor.isFree())
     self.socket_rr.send('["invalid"]')
     data = unserialize(self.socket_rr.recv())
     self.assertIsNotNone(data[1])
Esempio n. 3
0
 def handle():
     self.socket_rr.recv()
     scenario_data = [self.generateScenario(), {}]
     self.socket_rr.send(serialize(scenario_data))
     data = unserialize(self.socket_rr.recv())
     self.assertIsNone(data[1])