def test_wait(self): web_server.start() try: attempts, result = self.wait_for_web_server() self.assertTrue(attempts < self.MAX_ATTEMPTS or result == 0) self.assertTrue(web_server.running) except: # noqa web_server.stop() raise os.environ["PROJECTOR_SERVER_TIME"] = "0" wait() self.assertFalse(web_server.running) web_server.start() try: attempts, result = self.wait_for_web_server() self.assertTrue(attempts < self.MAX_ATTEMPTS or result == 0) self.assertTrue(web_server.running) finally: web_server.stop()
def test_stop(self): web_server.stop() # dummy test to avoid partially covered line in CI self.assertFalse(web_server.running) web_server.start() web_server.stop() self.assertFalse(web_server.running)