|
@@ -56,6 +56,7 @@ class TestMemorySegmentBuilder(unittest.TestCase):
|
|
|
|
|
|
def setUp(self):
|
|
|
self._create_builder_thread()
|
|
|
+ self.__mapped_file_path = None
|
|
|
|
|
|
def tearDown(self):
|
|
|
# It's the tests' responsibility to stop and join the builder
|
|
@@ -65,6 +66,10 @@ class TestMemorySegmentBuilder(unittest.TestCase):
|
|
|
self._master_sock.close()
|
|
|
self._builder_sock.close()
|
|
|
|
|
|
+ if self.__mapped_file_path is not None:
|
|
|
+ if os.path.exists(self.__mapped_file_path):
|
|
|
+ os.unlink(self.__mapped_file_path)
|
|
|
+
|
|
|
def test_bad_command(self):
|
|
|
"""Tests what happens when a bad command is passed to the
|
|
|
MemorySegmentBuilder.
|
|
@@ -163,6 +168,9 @@ class TestMemorySegmentBuilder(unittest.TestCase):
|
|
|
self.assertIsNone(sgmt_info.get_reset_param(SegmentInfo.READER))
|
|
|
self.assertIsNotNone(sgmt_info.get_reset_param(SegmentInfo.WRITER))
|
|
|
|
|
|
+ param = sgmt_info.get_reset_param(SegmentInfo.WRITER)
|
|
|
+ self.__mapped_file_path = param['mapped-file']
|
|
|
+
|
|
|
self._builder_thread.start()
|
|
|
|
|
|
# Now that the builder thread is running, send it the "load"
|