Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#163)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/pre-commit/mirrors-mypy: v1.10.0 → v1.10.1](pre-commit/mirrors-mypy@v1.10.0...v1.10.1)
- [github.com/astral-sh/ruff-pre-commit: v0.4.10 → v0.5.0](astral-sh/ruff-pre-commit@v0.4.10...v0.5.0)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] authored Jul 2, 2024
1 parent 19a534f commit 9066b23
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ repos:


- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.10.0'
rev: 'v1.10.1'
hooks:
- id: mypy
additional_dependencies:
- fastapi
- pytest

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.4.10'
rev: 'v0.5.0'
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down
8 changes: 4 additions & 4 deletions tests/routers/openml/dataset_tag_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def test_dataset_tag_rejects_unauthorized(key: ApiKey, py_api: TestClient) -> No
json={"data_id": list(constants.PRIVATE_DATASET_ID)[0], "tag": "test"},
)
assert response.status_code == http.client.PRECONDITION_FAILED
assert {"code": "103", "message": "Authentication failed"} == response.json()["detail"]
assert response.json()["detail"] == {"code": "103", "message": "Authentication failed"}


@pytest.mark.parametrize(
Expand All @@ -36,7 +36,7 @@ def test_dataset_tag(key: ApiKey, expdb_test: Connection, py_api: TestClient) ->
json={"data_id": dataset_id, "tag": tag},
)
assert response.status_code == http.client.OK
assert {"data_tag": {"id": str(dataset_id), "tag": tag}} == response.json()
assert response.json() == {"data_tag": {"id": str(dataset_id), "tag": tag}}

tags = get_tags(dataset_id=dataset_id, connection=expdb_test)
assert tag in tags
Expand All @@ -49,7 +49,7 @@ def test_dataset_tag_returns_existing_tags(py_api: TestClient) -> None:
json={"data_id": dataset_id, "tag": tag},
)
assert response.status_code == http.client.OK
assert {"data_tag": {"id": str(dataset_id), "tag": ["study_14", tag]}} == response.json()
assert response.json() == {"data_tag": {"id": str(dataset_id), "tag": ["study_14", tag]}}


def test_dataset_tag_fails_if_tag_exists(py_api: TestClient) -> None:
Expand Down Expand Up @@ -84,4 +84,4 @@ def test_dataset_tag_invalid_tag_is_rejected(
)

assert new.status_code == http.client.UNPROCESSABLE_ENTITY
assert ["body", "tag"] == new.json()["detail"][0]["loc"]
assert new.json()["detail"][0]["loc"] == ["body", "tag"]
4 changes: 2 additions & 2 deletions tests/routers/openml/datasets_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def test_error_unknown_dataset(
response = py_api.get(f"/datasets/{dataset_id}")

assert response.status_code == response_code
assert {"code": "111", "message": "Unknown dataset"} == response.json()["detail"]
assert response.json()["detail"] == {"code": "111", "message": "Unknown dataset"}


def test_get_dataset(py_api: TestClient) -> None:
Expand Down Expand Up @@ -81,7 +81,7 @@ def test_private_dataset_no_user_no_access(
response = py_api.get(f"/datasets/130{query}")

assert response.status_code == response_code
assert {"code": "112", "message": "No access granted"} == response.json()["detail"]
assert response.json()["detail"] == {"code": "112", "message": "No access granted"}


@pytest.mark.skip("Not sure how to include apikey in test yet.")
Expand Down
4 changes: 2 additions & 2 deletions tests/routers/openml/migration/datasets_migration_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def test_error_unknown_dataset(

# The new API has "404 Not Found" instead of "412 PRECONDITION_FAILED"
assert response.status_code == http.client.NOT_FOUND
assert {"code": "111", "message": "Unknown dataset"} == response.json()["detail"]
assert response.json()["detail"] == {"code": "111", "message": "Unknown dataset"}


@pytest.mark.parametrize(
Expand All @@ -115,7 +115,7 @@ def test_private_dataset_no_user_no_access(

# New response is 403: Forbidden instead of 412: PRECONDITION FAILED
assert response.status_code == http.client.FORBIDDEN
assert {"code": "112", "message": "No access granted"} == response.json()["detail"]
assert response.json()["detail"] == {"code": "112", "message": "No access granted"}


@pytest.mark.skip("Not sure how to include apikey in test yet.")
Expand Down

0 comments on commit 9066b23

Please sign in to comment.