Skip to content

Commit

Permalink
Adapt test to new type
Browse files Browse the repository at this point in the history
  • Loading branch information
Bobronium committed Oct 10, 2024
1 parent 86411f4 commit 4cf1ac5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@ def test_can_list_assignments_200(client: TestClient, session: Session) -> None:
"chain_id": ((cvat_projects[0].chain_id, len(assignments)),),
"assignment_id": (
(assignments[0].id, 1),
("unknown", 0),
(uuid.uuid4(), 0),
),
"job_type": (
(cvat_projects[0].job_type, len(assignments)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,7 @@ def test_process_incoming_recording_oracle_webhooks_submission_rejected_type_inv
status=OracleWebhookStatuses.pending.value,
event_type=RecordingOracleEventTypes.submission_rejected.value,
event_data={
"assignments": [
{"assignment_id": "sample assignment id", "reason": "sample reason"}
]
"assignments": [{"assignment_id": str(uuid.uuid4()), "reason": "sample reason"}]
},
direction=OracleWebhookDirectionTags.incoming,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def test_get_project_by_id(self):
assert project.escrow_address == escrow_address
assert project.bucket_url == bucket_url

project = cvat_service.get_project_by_id(self.session, "dummy_id")
project = cvat_service.get_project_by_id(self.session, uuid.uuid4())

assert project is None

Expand Down Expand Up @@ -533,7 +533,7 @@ def test_delete_project_wrong_project_id(self):
projects = self.session.query(Project).all()
assert len(projects) == 1
with pytest.raises(UnmappedInstanceError):
cvat_service.delete_project(self.session, "project_id")
cvat_service.delete_project(self.session, uuid.uuid4())

def test_create_task(self):
cvat_id = 1
Expand Down Expand Up @@ -597,7 +597,7 @@ def test_get_task_by_id(self):
assert task.cvat_project_id == cvat_project.cvat_id
assert task.status == TaskStatuses.annotation.value

task = cvat_service.get_task_by_id(self.session, "dummy_id")
task = cvat_service.get_task_by_id(self.session, uuid.uuid4())

assert task is None

Expand Down Expand Up @@ -908,7 +908,7 @@ def test_get_job_by_id(self):
assert job.cvat_task_id == cvat_task.cvat_id
assert job.cvat_project_id == cvat_project.cvat_id

job = cvat_service.get_job_by_id(self.session, "Dummy id")
job = cvat_service.get_job_by_id(self.session, uuid.uuid4())

assert job is None

Expand Down

0 comments on commit 4cf1ac5

Please sign in to comment.