"""Test the API.""" import pytest from dataexport.conf import config def test_health_check(test_client): response = test_client.get('http://localhost' + config.HEALTH_CHECK) assert response.status_code == 200 assert response.json() == {"status": "ok"} @pytest.mark.parametrize( "name, num", [ ("Joe", None), ("Michael", 42), ], ) def test_test(test_client, name, num): uri = f"http://localhost/test/{name}" if num is not None: uri += f"?num={num}" response = test_client.get(uri) assert response.status_code == 200 assert response.json() == {"hello": name, "num": num}