minor bug fix found through the power of unittests :)
This commit is contained in:
committed by
Salad Dais
parent
7ff5115786
commit
6b59f96ae6
@@ -57,7 +57,7 @@ class MessageManager(object):
|
||||
self.message_handler = MessageHandler()
|
||||
|
||||
logger.debug("Initializing the Message Manager ")
|
||||
|
||||
|
||||
self.host = Host((region.sim_ip, region.sim_port))
|
||||
# initialize the manager's base attributes
|
||||
#self.builder = MessageBuilder() #
|
||||
@@ -104,7 +104,7 @@ class MessageManager(object):
|
||||
def stop_monitors(self):
|
||||
""" stops monitoring coroutines """
|
||||
#stops udp_dispatcher
|
||||
self._running = False
|
||||
self._is_running = False
|
||||
#stops event_queue
|
||||
if self.event_queue._running:
|
||||
self.event_queue.stop()
|
||||
|
||||
@@ -40,12 +40,16 @@ class TestMessageManager(unittest.TestCase):
|
||||
def tearDown(self):
|
||||
pass
|
||||
|
||||
def test_start_monitors(self):
|
||||
def test_start_stop_monitors(self):
|
||||
self.message_manager.start_monitors()
|
||||
api.sleep(0)
|
||||
self.assertTrue(self.message_manager._is_running)
|
||||
api.sleep(.1)
|
||||
self.assertTrue(self.message_manager.event_queue._running)
|
||||
|
||||
self.message_manager.stop_monitors()
|
||||
api.sleep(0)
|
||||
self.assertFalse(self.message_manager._is_running)
|
||||
#self.assertFalse(self.message_manager.event_queue._running)
|
||||
|
||||
def test_enqueue_message(self):
|
||||
pass
|
||||
|
||||
|
||||
Reference in New Issue
Block a user