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()
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()
def stop_and_wait(self): self.stop() Utils.wait_until(self.is_stopped, tick=True)
def tearDown(self): self.server.stop() Utils.wait_until(self.server.is_stopped)
def start_and_wait(self): self.start() Utils.wait_until(self.is_running, tick=True)