Skip to content

Commit

Permalink
Merge pull request #120 from simonsobs/dev
Browse files Browse the repository at this point in the history
Fix type errors
  • Loading branch information
TaiSakuma authored Sep 9, 2024
2 parents bb38406 + fa83a45 commit f8231c7
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
2 changes: 2 additions & 0 deletions tests/schema/mutations/test_delete_runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from hypothesis import given, note
from hypothesis import strategies as st
from sqlalchemy import select
from strawberry.types import ExecutionResult

from nextline_rdb.db import DB
from nextline_rdb.models import Run
Expand Down Expand Up @@ -60,6 +61,7 @@ async def test_delete_runs(data: st.DataObject) -> None:
)
note(f'resp: {resp}')

assert isinstance(resp, ExecutionResult)
assert resp.data

expected = {run.id for run in to_delete}
Expand Down
6 changes: 6 additions & 0 deletions tests/schema/queries/test_pagination.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import strawberry
from hypothesis import given, note
from hypothesis import strategies as st
from strawberry.types import ExecutionResult

from nextline_rdb.db import DB
from nextline_rdb.models import Run
Expand Down Expand Up @@ -56,6 +57,7 @@ async def test_all(runs: list[Run]) -> None:
note(f'nodes_saved: {nodes_saved}')

resp = await schema.execute(QUERY_RDB_RUNS, context_value={'db': db})
assert isinstance(resp, ExecutionResult)
assert resp.data

all_runs = resp.data['rdb']['runs']
Expand Down Expand Up @@ -101,6 +103,7 @@ async def test_forward(runs: list[Run], first: int) -> None:
variable_values=dict(variables),
context_value={'db': db},
)
assert isinstance(resp, ExecutionResult)
assert resp.data

all_runs = resp.data['rdb']['runs']
Expand Down Expand Up @@ -153,6 +156,7 @@ async def test_backward(runs: list[Run], last: int) -> None:
variable_values=dict(variables),
context_value={'db': db},
)
assert isinstance(resp, ExecutionResult)
assert resp.data

all_runs = resp.data['rdb']['runs']
Expand Down Expand Up @@ -191,6 +195,7 @@ async def test_cursor(runs: list[Run]) -> None:
note(f'nodes_saved: {nodes_saved}')

resp = await schema.execute(QUERY_RDB_RUNS, context_value={'db': db})
assert isinstance(resp, ExecutionResult)
assert resp.data

all_runs = resp.data['rdb']['runs']
Expand Down Expand Up @@ -237,5 +242,6 @@ async def test_error(variables: Variables) -> None:
context_value={'db': db},
)

assert isinstance(resp, ExecutionResult)
assert not resp.data
assert resp.errors
2 changes: 2 additions & 0 deletions tests/schema/queries/test_rdb.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import strawberry
from hypothesis import Phase, given, note, settings
from strawberry.types import ExecutionResult

from nextline_rdb.db import DB
from nextline_rdb.models import Run
Expand All @@ -21,6 +22,7 @@ async def test_history(runs: list[Run]) -> None:

resp = await schema.execute(QUERY_RDB_CONNECTIONS, context_value={'db': db})

assert isinstance(resp, ExecutionResult)
assert resp.data
rdb = resp.data['rdb']
runs_ = rdb['runs']['edges']
Expand Down
4 changes: 3 additions & 1 deletion tests/schema/queries/test_run.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import strawberry
from hypothesis import Phase, given, note, settings
from hypothesis import strategies as st
from strawberry.types import ExecutionResult

from nextline_rdb.db import DB
from nextline_rdb.models import Run
Expand Down Expand Up @@ -66,7 +67,8 @@ async def test_run(data: st.DataObject) -> None:
QUERY_RDB_RUN, variable_values=variables, context_value={'db': db}
)
note(f'resp: {resp}')


assert isinstance(resp, ExecutionResult)
assert resp.data

run_ = resp.data['rdb']['run']
Expand Down

0 comments on commit f8231c7

Please sign in to comment.