Beispiel #1
0
	def process(self, data):
		self._logger.debug("received: %s", data)
		command = Command.construct(data)
		response = command.execute(self)
		serialized = response.serialized()
		self._logger.debug("response: %s", serialized)
		return serialized
Beispiel #2
0
	def test_fetch_command_construct(self):
		data = {'serial': 'fetch', 'name': 'obj'}
		built_command = Command.construct(data)
		self.assertIs(built_command.__class__, FetchCommand)
		serialized = built_command.serialized()
		self.assertEqual(serialized, data)