Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Panaetius committed Apr 19, 2022
1 parent f2f2613 commit 5cfaa27
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 15 deletions.
13 changes: 1 addition & 12 deletions conftest.py
Expand Up @@ -18,8 +18,6 @@
"""Pytest configuration."""
import importlib

from poetry_dynamic_versioning import _apply_version, _get_pyproject_path, _get_version, _revert_version, get_config

CLI_FIXTURE_LOCATIONS = [
"tests.cli.fixtures.cli_gateway",
"tests.cli.fixtures.cli_kg",
Expand Down Expand Up @@ -64,11 +62,7 @@


def pytest_configure(config):
"""Set version before tests run."""
poetry_config = get_config()
pyproject_path = _get_pyproject_path()
version = _get_version(poetry_config)
_apply_version(version, poetry_config, pyproject_path)
"""Run global setup before executing tests."""

for _fixture in INCLUDE_FIXTURES:
module = importlib.import_module(_fixture)
Expand All @@ -77,8 +71,3 @@ def pytest_configure(config):
if hasattr(module, "__all__")
else {k: v for (k, v) in module.__dict__.items() if not k.startswith("_")}
)


def pytest_unconfigure(config):
"""Revert version to 0.0.0 after tests run."""
_revert_version()
27 changes: 24 additions & 3 deletions tests/service/views/test_graph_views.py
Expand Up @@ -43,7 +43,14 @@ def test_graph_export_view(svc_client_cache, it_remote_repo_url):

assert_rpc_response(response)
assert "graph" in response.json["result"]
assert len(response.json["result"]["graph"]) == 5852
assert "https://dev.renku.ch/datasets/0b1e2d0211a39ef6ca941f161812e267" in response.json["result"]["graph"]
assert "https://dev.renku.ch/datasets/12e0ac1b427e4b0dab461f161812e267" in response.json["result"]["graph"]
assert (
"https://dev.renku.ch/projects/renku-python-integration-tests/core-integration-test"
in response.json["result"]["graph"]
)
assert "mailto:contact@justsam.io" in response.json["result"]["graph"]
assert len(response.json["result"]["graph"]) > 5000


@pytest.mark.service
Expand Down Expand Up @@ -79,7 +86,14 @@ def test_graph_export_no_callback(svc_client_cache, it_remote_repo_url):

assert_rpc_response(response)
assert "graph" in response.json["result"]
assert len(response.json["result"]["graph"]) == 5852
assert "https://dev.renku.ch/datasets/0b1e2d0211a39ef6ca941f161812e267" in response.json["result"]["graph"]
assert "https://dev.renku.ch/datasets/12e0ac1b427e4b0dab461f161812e267" in response.json["result"]["graph"]
assert (
"https://dev.renku.ch/projects/renku-python-integration-tests/core-integration-test"
in response.json["result"]["graph"]
)
assert "mailto:contact@justsam.io" in response.json["result"]["graph"]
assert len(response.json["result"]["graph"]) > 5000


@pytest.mark.service
Expand All @@ -94,4 +108,11 @@ def test_graph_export_no_revision(svc_client_cache, it_remote_repo_url):
response = svc_client.get("/graph.export", data=json.dumps(payload), headers=headers)
assert_rpc_response(response)
assert "graph" in response.json["result"]
assert len(response.json["result"]["graph"]) == 5852
assert "https://dev.renku.ch/datasets/0b1e2d0211a39ef6ca941f161812e267" in response.json["result"]["graph"]
assert "https://dev.renku.ch/datasets/12e0ac1b427e4b0dab461f161812e267" in response.json["result"]["graph"]
assert (
"https://dev.renku.ch/projects/renku-python-integration-tests/core-integration-test"
in response.json["result"]["graph"]
)
assert "mailto:contact@justsam.io" in response.json["result"]["graph"]
assert len(response.json["result"]["graph"]) > 5000

0 comments on commit 5cfaa27

Please sign in to comment.