Skip to content

Commit

Permalink
[FIX] black complaints
Browse files Browse the repository at this point in the history
  • Loading branch information
surchs committed Oct 16, 2024
1 parent eadc1da commit cea8527
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 12 deletions.
10 changes: 8 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,18 @@

def pytest_addoption(parser):
parser.addoption(
"--runintegration", action="store_true", default=False, help="run integration tests"
"--runintegration",
action="store_true",
default=False,
help="run integration tests",
)


def pytest_configure(config):
config.addinivalue_line("markers", "integration: mark integration tests that need the test graph to run")
config.addinivalue_line(
"markers",
"integration: mark integration tests that need the test graph to run",
)


def pytest_collection_modifyitems(config, items):
Expand Down
27 changes: 17 additions & 10 deletions tests/test_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ def test_query_without_token_succeeds_when_auth_disabled(
mock_successful_get,
monkeypatch,
disable_auth,
set_test_credentials
set_test_credentials,
):
"""
Test that when authentication is disabled, a request to the /query route without a token succeeds.
Expand All @@ -631,19 +631,26 @@ def test_query_without_token_succeeds_when_auth_disabled(

@pytest.mark.integration
def test_integration_query_without_auth_succeeds(
test_app,
monkeypatch,
disable_auth,
set_test_credentials
test_app, monkeypatch, disable_auth, set_test_credentials
):
"""
Running a test against a real local test graph
should succeed when authentication is disabled.
"""
monkeypatch.setattr(util, "GRAPH_DB", util.EnvVar(util.GRAPH_DB.name, "repositories/my_db"))
monkeypatch.setattr(util, "GRAPH_ADDRESS", util.EnvVar(util.GRAPH_ADDRESS.name, "127.0.0.1"))
monkeypatch.setattr(util, "GRAPH_PORT", util.EnvVar(util.GRAPH_PORT.name, "7200"))
monkeypatch.setattr(util, "QUERY_URL", "http://localhost:7200/repositories/my_db")
monkeypatch.setattr(
util, "GRAPH_DB", util.EnvVar(util.GRAPH_DB.name, "repositories/my_db")
)
monkeypatch.setattr(
util,
"GRAPH_ADDRESS",
util.EnvVar(util.GRAPH_ADDRESS.name, "127.0.0.1"),
)
monkeypatch.setattr(
util, "GRAPH_PORT", util.EnvVar(util.GRAPH_PORT.name, "7200")
)
monkeypatch.setattr(
util, "QUERY_URL", "http://localhost:7200/repositories/my_db"
)

response = test_app.get(ROUTE)
assert response.status_code == 200
assert response.status_code == 200

0 comments on commit cea8527

Please sign in to comment.