Skip to content

Commit

Permalink
style: apply pre-commit hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
afuetterer committed Aug 19, 2024
1 parent b516cde commit 8359b41
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ def repository_list_xml() -> str:
"""


@pytest.fixture()
@pytest.fixture
def mock_repository_list_route(respx_mock: MockRouter, repository_list_xml: str) -> Route:
return respx_mock.get("https://www.re3data.org/api/beta/repositories").mock(
return_value=httpx.Response(httpx.codes.OK, text=repository_list_xml)
)


@pytest.fixture()
@pytest.fixture
def mock_repository_list_query_route(respx_mock: MockRouter) -> Route:
query_result_xml = """<?xml version="1.0" encoding="UTF-8"?>
<list>
Expand All @@ -86,7 +86,7 @@ def mock_repository_list_query_route(respx_mock: MockRouter) -> Route:
)


@pytest.fixture()
@pytest.fixture
def mock_repository_list_query_empty_list_route(respx_mock: MockRouter) -> Route:
query_result_xml = '<?xml version="1.0" encoding="UTF-8"?><list></list>'
return respx_mock.get("https://www.re3data.org/api/beta/repositories?query=XXX").mock(
Expand Down Expand Up @@ -283,14 +283,14 @@ def repository_get_xml() -> str:
return REPOSITORY_GET_XML


@pytest.fixture()
@pytest.fixture
def mock_repository_get_route(respx_mock: MockRouter) -> Route:
return respx_mock.get("https://www.re3data.org/api/beta/repository/r3d100010468").mock(
return_value=httpx.Response(httpx.codes.OK, text=REPOSITORY_GET_XML)
)


@pytest.fixture()
@pytest.fixture
def mock_server_error(respx_mock: MockRouter) -> Route:
return respx_mock.get("https://www.re3data.org/api/beta/repositories").mock(
return_value=httpx.Response(httpx.codes.INTERNAL_SERVER_ERROR)
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ async def test_client_get_single_repository_response(


@pytest.mark.default_cassette("repository.yaml")
@pytest.mark.vcr()
@pytest.mark.vcr
async def test_client_get_invalid_repository_id(async_client: AsyncClient) -> None:
with pytest.raises(RepositoryNotFoundError):
await async_client.repositories.get("XXX")
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def test_repository_get_with_repository_id_invalid_return_type(zenodo_id: str) -


@pytest.mark.default_cassette("repository.yaml")
@pytest.mark.vcr()
@pytest.mark.vcr
def test_repository_get_with_invalid_repository_id() -> None:
result = runner.invoke(app, ["repository", "get", "XXX"])
assert result.exit_code == 1
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def test_client_get_single_repository_response(


@pytest.mark.default_cassette("repository.yaml")
@pytest.mark.vcr()
@pytest.mark.vcr
def test_client_get_invalid_repository_id(client: Client) -> None:
with pytest.raises(RepositoryNotFoundError):
client.repositories.get("XXX")
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/test_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
PARSER = XmlParser(context=CONTEXT)


@pytest.fixture()
@pytest.fixture
def repository_list(repository_list_xml: str) -> RepositoryList:
return PARSER.from_string(repository_list_xml, RepositoryList)


@pytest.fixture()
@pytest.fixture
def repository_summary(repository_list: RepositoryList) -> RepositorySummary:
return repository_list.repository[0]

Expand Down

0 comments on commit 8359b41

Please sign in to comment.