コード例 #1
0
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)
コード例 #2
0
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