예제 #1
0
    def test_operations(self):
        assert not self.server.is_running()
        assert self.server.is_stopped()

        thread.start_new_thread(self.server.start, ())
        assert not self.server.is_running()  # still starting
        Utils.wait_until(self.server.is_running, tick=True)
        assert not self.server.is_stopped()  # has started starting

        thread.start_new_thread(self.server.restart, ())
        Utils.wait_until(self.server.is_stopped, tick=True)  # first should stop
        Utils.wait_until(self.server.is_running, tick=True)  # then should start

        self.server.stop()
        Utils.wait_until(self.server.is_stopped, tick=True)  # also takes some time
        assert not self.server.is_running()
예제 #2
0
    def test_operations(self):
        assert not self.server.is_running()
        assert self.server.is_stopped()

        self.server.start()
        assert not self.server.is_running()  # still starting
        Utils.wait_until(self.server.is_running, tick=True)
        assert not self.server.is_stopped()  # has started starting

        thread.start_new_thread(self.server.restart, ())
        Utils.wait_until(self.server.is_stopped,
                         tick=True)  # first should stop
        Utils.wait_until(self.server.is_running, tick=True)  # then should run

        self.server.stop_and_wait()
        assert not self.server.is_running()
예제 #3
0
 def stop_and_wait(self):
     self.stop()
     Utils.wait_until(self.is_stopped, tick=True)
예제 #4
0
 def tearDown(self):
     self.server.stop()
     Utils.wait_until(self.server.is_stopped)
예제 #5
0
 def start_and_wait(self):
     self.start()
     Utils.wait_until(self.is_running, tick=True)