Browse Source

[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.
Mukund Sivaraman 12 years ago
parent
commit
ee58a132fe

+ 1 - 1
src/lib/python/isc/memmgr/builder.py

@@ -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

+ 4 - 1
src/lib/python/isc/memmgr/tests/builder_tests.py

@@ -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):