2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-31 14:05:33 +00:00

[2855] Make the response a tuple

This is for some kind of compatibility with future tickets, but the
exact format of the response list is currently not decided.
This commit is contained in:
Mukund Sivaraman
2013-06-24 02:14:09 +05:30
parent e15f18aff6
commit ee58a132fe
2 changed files with 5 additions and 2 deletions

View File

@@ -91,7 +91,7 @@ class MemorySegmentBuilder:
# notified. Instead return this in the response
# queue.
with self._lock:
self._response_queue.append('bad_command')
self._response_queue.append(('bad_command',))
# In this case, we do not notify the main
# thread about a response on the socket, as
# we quit the main loop here anyway (and any

View File

@@ -73,7 +73,10 @@ class TestMemorySegmentBuilder(unittest.TestCase):
with self._builder_lock:
self.assertEqual(len(self._builder_command_queue), 0)
self.assertEqual(len(self._builder_response_queue), 1)
self.assertListEqual(self._builder_response_queue, ['bad_command'])
response = self._builder_response_queue[0]
self.assertTrue(isinstance(response, tuple))
self.assertTupleEqual(response, ('bad_command',))
self._builder_response_queue.clear()
def test_shutdown(self):