Skip to content

Commit

Permalink
fix test and structure of db payload
Browse files Browse the repository at this point in the history
  • Loading branch information
sanderegg committed Apr 25, 2023
1 parent 6e5da21 commit daed72c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,10 @@ async def _update_project_state(

@dataclass(frozen=True)
class _CompTaskNotificationPayload:
action: str
data: dict
changes: dict
table: str


async def _handle_db_notification(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,10 @@ async def test_listen_comp_tasks_task(
some_project = project(logged_user)
pipeline(project_id=f"{some_project.uuid}")
task = comp_task(
project_id=f"{some_project.uuid}", outputs=json.dumps({}), node_class=task_class
project_id=f"{some_project.uuid}",
node_id=faker.uuid4(),
outputs=json.dumps({}),
node_class=task_class,
)
async with db_engine.acquire() as conn:
# let's update some values
Expand All @@ -153,7 +156,7 @@ async def test_listen_comp_tasks_task(
.where(comp_tasks.c.task_id == task["task_id"])
)

# tests whether listener gets hooked calls executed
# tests whether listener gets executed
for call_name, mocked_call in mock_project_subsystem.items():
if call_name in expected_calls:
async for attempt in AsyncRetrying(
Expand Down

0 comments on commit daed72c

Please sign in to comment.