Skip to content

Commit

Permalink
fix vioscreen test
Browse files Browse the repository at this point in the history
  • Loading branch information
ayobi committed Sep 10, 2024
1 parent 9102276 commit 101667d
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions microsetta_private_api/repo/tests/test_vioscreen_sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,14 +267,14 @@ def test_get_ffq_status_by_sample(self):
r = VioscreenSessionRepo(t)
r.upsert_session(session_copy)
session = r.get_sessions_by_username(VIOSCREEN_USERNAME1)[0]

cur = t.cursor()
query = """
source_id_query = """
SELECT source_id
FROM ag.vioscreen_registry
WHERE sample_id = %s
"""
cur.execute(query, (BARCODE_UUID_FOR_VIOSESSION,))
cur.execute(source_id_query, (BARCODE_UUID_FOR_VIOSESSION,))
source_id = cur.fetchone()

obs = r.get_ffq_status_by_source(SOURCE_ID_NOTIN_REGISTRY)
Expand All @@ -287,24 +287,28 @@ def test_get_ffq_status_by_sample(self):
# enumerate the empirically observed states from vioscreen
# (is_complete, has_taken, exact_status)
obs = r.get_ffq_status_by_source(source_id)
self.assertEqual(obs, (True, True, 'Finishedd'))
self.assertEqual(obs, [(True, True, 'Finished'),
(True, True, 'Finished')])

session.status = 'Started'
session.endDate = None
r.upsert_session(session)

obs = r.get_ffq_status_by_source(source_id)
self.assertEqual(obs, (False, True, 'Started'))
self.assertEqual(obs, [(False, True, 'Started'),
(False, True, 'Started')])

session.status = 'New'
r.upsert_session(session)
obs = r.get_ffq_status_by_source(source_id)
self.assertEqual(obs, (False, False, 'New'))
self.assertEqual(obs, [(False, False, 'New'),
(False, False, 'New')])

session.status = 'Review'
r.upsert_session(session)
obs = r.get_ffq_status_by_source(source_id)
self.assertEqual(obs, (False, True, 'Review'))
self.assertEqual(obs, [(False, True, 'Review'),
(False, True, 'Review')])


if __name__ == '__main__':
Expand Down

0 comments on commit 101667d

Please sign in to comment.