def test_service_group_start(): test_service_1 = HttpService(SERVICE_COMMAND) test_service_2 = HttpService(SERVICE_COMMAND) with ServiceGroup(test_service_1, test_service_2): assert requests.get(test_service_1.url).status_code == 200 assert requests.get(test_service_2.url).status_code == 200
def test_service_group_stop_timeout(): with FakeHttpService(lock_stop=True) as service_1, FakeHttpService( lock_stop=True) as service_2: services = ServiceGroup(service_1, service_2) services.start() with pytest.raises(TimeoutError): services.stop(timeout=0.00000001)
def test_service_group_stop_timeout(): with FakeHttpService(lock_stop=True) as service_1, FakeHttpService(lock_stop=True) as service_2: services = ServiceGroup(service_1, service_2) services.start() with pytest.raises(TimeoutError): services.stop(timeout=0.00000001)
def test_service_group_start_timeout(): services = ServiceGroup(HttpService(TEST_SERVICE_COMMAND), HttpService(TEST_SERVICE_COMMAND)) with pytest.raises(TimeoutError): services.start(timeout=0.001)