예제 #1
0
 def __init__(self, quick_death=False, loop_interval=0.750):
     """
     Very important to note that this service has a loop interval of 750ms by default.
     :param quick_death:
     :param loop_interval:
     :return:
     """
     name = "mock-output-service"
     QueuedService.__init__(self, name)
     self.register_child_stat(name)
     self.event_loop_ack = False
     self.quick_death = quick_death
     self.loop_interval = loop_interval
예제 #2
0
 def __init__(self, quick_death=False, loop_interval=.750):
     """
     Very important to note that this service has a loop interval of 750ms by default.
     :param quick_death:
     :param loop_interval:
     :return:
     """
     name = "mock-output-service"
     QueuedService.__init__(self, name)
     self.register_child_stat(name)
     self.event_loop_ack = False
     self.quick_death = quick_death
     self.loop_interval = loop_interval
def test_output_service():
    # Test Output service class
    output = QueuedService("out-1")
    assert output is not None

    output.put("1")
    assert output.size() == 1

    val = output.get()
    assert val == "1"
    assert output.size() == 0