Skip to content

Commit

Permalink
fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanDietzMorris committed Apr 16, 2024
1 parent ebc0fc6 commit 4e0c9eb
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions PLATER/tests/test_endpoint_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from PLATER.services.util.graph_adapter import GraphInterface
import os

from PLATER.services.app_common import APP_COMMON, get_graph_interface
from PLATER.services.app_trapi import APP, get_graph_interface


class MockGraphInterface(GraphInterface):
Expand Down Expand Up @@ -72,12 +72,12 @@ def graph_interface():
return _graph_interface()


APP_COMMON.dependency_overrides[get_graph_interface] = _graph_interface
APP.dependency_overrides[get_graph_interface] = _graph_interface


@pytest.mark.asyncio
async def test_node_response(graph_interface):
async with AsyncClient(app=APP_COMMON, base_url="http://test") as ac:
async with AsyncClient(app=APP, base_url="http://test") as ac:
response = await ac.get("/chemical_substance/curie")
assert response.status_code == 200
graph_response = await graph_interface.get_node('chemical_substance', 'curie')
Expand All @@ -86,7 +86,7 @@ async def test_node_response(graph_interface):

@pytest.mark.asyncio
async def test_one_hop_response(graph_interface):
async with AsyncClient(app=APP_COMMON, base_url="http://test") as ac:
async with AsyncClient(app=APP, base_url="http://test") as ac:
response = await ac.get("/chemical_substance/gene/CHEBI:11492")
assert response.status_code == 200
graph_response = await graph_interface.get_single_hops('chemical_substance', 'gene', 'CHEBI:11492')
Expand All @@ -96,7 +96,7 @@ async def test_one_hop_response(graph_interface):
@pytest.mark.asyncio
async def test_cypher_response(graph_interface):
query = 'MATCH (n) return n limit 1'
async with AsyncClient(app=APP_COMMON, base_url="http://test") as ac:
async with AsyncClient(app=APP, base_url="http://test") as ac:
response = await ac.post("/cypher", json={
"query": query
})
Expand All @@ -107,7 +107,7 @@ async def test_cypher_response(graph_interface):

# @pytest.mark.asyncio
# async def test_graph_schema_response(graph_interface):
# async with AsyncClient(app=APP_COMMON, base_url="http://test") as ac:
# async with AsyncClient(app=APP, base_url="http://test") as ac:
# response = await ac.get("/graph/schema")
# assert response.status_code == 200
# assert response.json() == graph_interface.get_schema()
Expand All @@ -117,7 +117,7 @@ async def test_cypher_response(graph_interface):
async def test_simple_one_hop_spec_response(graph_interface):
# with out parameters it should return all the questions based on that
# send source parameter, target parameter
async with AsyncClient(app=APP_COMMON, base_url="http://test") as ac:
async with AsyncClient(app=APP, base_url="http://test") as ac:
response = await ac.get("/simple_spec")
assert response.status_code == 200
specs = response.json()
Expand Down

0 comments on commit 4e0c9eb

Please sign in to comment.