File tree Expand file tree Collapse file tree 1 file changed +0
-20
lines changed
services/notifications/tests/unit Expand file tree Collapse file tree 1 file changed +0
-20
lines changed Original file line number Diff line number Diff line change 77from fastapi .testclient import TestClient
88from models_library .api_schemas__common .health import HealthCheckGet
99from models_library .errors import (
10- POSRGRES_DATABASE_UNHEALTHY_MSG ,
1110 RABBITMQ_CLIENT_UNHEALTHY_MSG ,
1211)
13- from models_library .healthchecks import IsNonResponsive
1412from pytest_mock import MockerFixture
1513from simcore_service_notifications .api .rest ._health import HealthCheckError
1614
1715pytest_simcore_core_services_selection = [
18- "postgres" ,
1916 "rabbit" ,
2017]
2118
@@ -26,23 +23,6 @@ def test_health_ok(test_client: TestClient):
2623 assert HealthCheckGet .model_validate (response .json ())
2724
2825
29- @pytest .fixture
30- def mock_postgres_liveness (mocker : MockerFixture , test_client : TestClient ) -> None :
31- mocker .patch .object (
32- test_client .app .state .postgres_liveness ,
33- "_liveness_result" ,
34- new = IsNonResponsive (reason = "fake" ),
35- )
36-
37-
38- def test_health_postgres_unhealthy (
39- mock_postgres_liveness : None , test_client : TestClient
40- ):
41- with pytest .raises (HealthCheckError ) as exc :
42- test_client .get ("/" )
43- assert POSRGRES_DATABASE_UNHEALTHY_MSG in f"{ exc .value } "
44-
45-
4626@pytest .fixture
4727def mock_rabbit_healthy (mocker : MockerFixture , test_client : TestClient ) -> None :
4828 mocker .patch .object (
You can’t perform that action at this time.
0 commit comments