def test_getCommand_with_empty_command_queue(self): dispatcher = Dispatcher() #speed up the queue timeout for testing dispatcher.QUEUE_TIMEOUT = .001 expected_result = 'ERROR: Command queue was empty' retrieved_result = dispatcher.getCommand() self.assertEquals(expected_result, retrieved_result)
def test_getCommand(self): dispatcher = Dispatcher() sample_command = expected_result = '|open|http://localhost/||' dispatcher.addCommand(sample_command) retrieved_result = dispatcher.getCommand() self.assertEquals(expected_result, retrieved_result)