Skip to content

Commit

Permalink
update vioscreen test
Browse files Browse the repository at this point in the history
  • Loading branch information
ayobi committed Sep 10, 2024
1 parent 6084b95 commit b781035
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
8 changes: 4 additions & 4 deletions microsetta_private_api/repo/tests/test_vioscreen_sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,24 +278,24 @@ 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_FOR_VIOSESSION)
self.assertEqual(obs, (True, True, 'Finished'))
self.assertEqual(obs[1], (True, True, 'Finished'))

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

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

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

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


if __name__ == '__main__':
Expand Down
4 changes: 0 additions & 4 deletions microsetta_private_api/repo/vioscreen_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,6 @@ def upsert_session(self, session):
{doupdateset}
""",
tuple([getattr(session, attr) for attr in self.COLS]))
cur.execute("SELECT * FROM ag.vioscreen_sessions "
"WHERE sessionId = %s", (session.sessionId,))
row = cur.fetchone()
print("Upserted row:", row)
return cur.rowcount == 1

def get_session(self, sessionId):
Expand Down

0 comments on commit b781035

Please sign in to comment.