pytest-api/tests/open_service/test_gammaworld.py

23 lines
787 B
Python
Raw Permalink Normal View History

2024-07-20 16:35:15 +00:00
import json
2024-07-22 18:26:27 +00:00
2024-07-20 16:35:15 +00:00
import pytest
from apiclient.client import api_client
2024-07-22 18:26:27 +00:00
from tests.helpers import get_expected_response
pkg_name = __package__.split('.')[1]
2024-07-20 16:35:15 +00:00
@pytest.mark.rules
def test_get_creatures(request, get_creatures_call):
2024-07-22 18:26:27 +00:00
expected_response = get_expected_response(pkg_name, request.node.name)
actual_response = api_client(get_creatures_call, oauth=False)
2024-07-20 16:35:15 +00:00
assert json.dumps(actual_response, indent=4) == json.dumps(expected_response, indent=4)
@pytest.mark.rules
def test_get_creature(request, get_creature_call):
2024-07-22 18:26:27 +00:00
expected_response = get_expected_response(pkg_name, request.node.name)
actual_response = api_client(get_creature_call, oauth=False)
2024-07-22 18:26:27 +00:00
assert json.dumps(actual_response, indent=4) == json.dumps(expected_response, indent=4)