diff --git a/load_tests/api.py b/load_tests/api.py index b080479..3d1956e 100644 --- a/load_tests/api.py +++ b/load_tests/api.py @@ -64,5 +64,10 @@ class BackendApi(): def dummy_get(self, auth: Auth): headers = {"X-Auth": auth.token} response = self.http.client.get("/dummy", headers=headers) + if response.status_code != 200: + raise AssertionError('something wrong') + + def health_get(self): + response = self.http.client.get("/health") if response.status_code != 200: raise AssertionError('something wrong') \ No newline at end of file diff --git a/load_tests/tests/health.py b/load_tests/tests/health.py new file mode 100644 index 0000000..df5ddc5 --- /dev/null +++ b/load_tests/tests/health.py @@ -0,0 +1,13 @@ +from locust import FastHttpUser, task + +from api import BackendApi + +class HealthGet(FastHttpUser): + api: BackendApi + + @task + def user_create_test(self): + self.api.health_get() + + def on_start(self): + self.api = BackendApi(self) \ No newline at end of file