mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-09-03 23:45:27 +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:
@@ -91,7 +91,7 @@ class MemorySegmentBuilder:
|
|||||||
# notified. Instead return this in the response
|
# notified. Instead return this in the response
|
||||||
# queue.
|
# queue.
|
||||||
with self._lock:
|
with self._lock:
|
||||||
self._response_queue.append('bad_command')
|
self._response_queue.append(('bad_command',))
|
||||||
# In this case, we do not notify the main
|
# In this case, we do not notify the main
|
||||||
# thread about a response on the socket, as
|
# thread about a response on the socket, as
|
||||||
# we quit the main loop here anyway (and any
|
# we quit the main loop here anyway (and any
|
||||||
|
@@ -73,7 +73,10 @@ class TestMemorySegmentBuilder(unittest.TestCase):
|
|||||||
with self._builder_lock:
|
with self._builder_lock:
|
||||||
self.assertEqual(len(self._builder_command_queue), 0)
|
self.assertEqual(len(self._builder_command_queue), 0)
|
||||||
self.assertEqual(len(self._builder_response_queue), 1)
|
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()
|
self._builder_response_queue.clear()
|
||||||
|
|
||||||
def test_shutdown(self):
|
def test_shutdown(self):
|
||||||
|
Reference in New Issue
Block a user