]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2855] Make the response a tuple
authorMukund Sivaraman <muks@isc.org>
Sun, 23 Jun 2013 20:44:09 +0000 (02:14 +0530)
committerMukund Sivaraman <muks@isc.org>
Sun, 30 Jun 2013 15:57:22 +0000 (21:27 +0530)
This is for some kind of compatibility with future tickets, but the
exact format of the response list is currently not decided.

src/lib/python/isc/memmgr/builder.py
src/lib/python/isc/memmgr/tests/builder_tests.py

index f01f830c7587c22afb6378f2ec1f9e8ef1be1516..2e8b71ca5c00317a5dd9e066fafd1d69471a5c07 100644 (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
index 2b213372842a35cd32510d857c65f6bdc5d55c8a..230f39618d77dcb6b294d5311638e52d93facc78 100644 (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):