Ejemplo n.º 1
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
Ejemplo n.º 2
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)
Ejemplo n.º 3
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)
Ejemplo n.º 4
0
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)