Skip to content

Commit cb05237

Browse files
fix: Fixed client (+2 squashed commits)
Squashed commits: [855dd32] fix: Fixed client [7701995] fix: Fixed tests: had list instead of set + optimize
1 parent 48bbdf6 commit cb05237

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

diracx-db/tests/pilot_agents/test_pilot_agents_db.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,20 @@ async def test_jobs_association(pilot_agents_db: PilotAgentsDB):
6262

6363
# Get the jobs associated with the first pilot
6464
fetched_job_ids = await pilot_agents_db.get_pilot_job_ids(pilot_id)
65+
# Convert to set, it is easier to play with
66+
fetched_job_ids_set = set(fetched_job_ids)
67+
job_ids_set = set(job_ids)
68+
6569
# Asserts
6670
assert len(fetched_job_ids) == len(job_ids)
67-
assert fetched_job_ids.issubset(job_ids)
68-
assert job_ids.issubset(fetched_job_ids)
71+
assert fetched_job_ids_set == job_ids_set
6972

7073
# Get the jobs associated with the second pilot
71-
fetched_job_ids = await pilot_agents_db.get_pilot_job_ids(pilot_id_2)
74+
fetched_job_ids_2 = await pilot_agents_db.get_pilot_job_ids(pilot_id_2)
75+
# Convert to set, it is easier to play with
76+
fetched_job_ids_set_2 = set(fetched_job_ids_2)
77+
job_ids_set_2 = set(job_ids_2)
78+
79+
# Asserts
7280
assert len(fetched_job_ids) == len(job_ids_2)
73-
assert fetched_job_ids.issubset(job_ids_2)
74-
assert job_ids_2.issubset(fetched_job_ids)
81+
assert fetched_job_ids_set_2 == job_ids_set_2

0 commit comments

Comments
 (0)