Skip to content

Commit

Permalink
modify test function for new workflowrun model
Browse files Browse the repository at this point in the history
  • Loading branch information
raylrui committed Sep 9, 2024
1 parent b35b6f4 commit 5fce7a7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def to_dict(self):

def get_all_states(self):
# retrieve all states (DB records rather than a queryset)
return list(self.state_set.all()) # TODO: ensure order by timestamp ?
return list(self.states.all()) # TODO: ensure order by timestamp ?

def get_latest_state(self):
# retrieve all related states and get the latest one
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def test_create_wrsc_no_library(self):
db_wfr: WorkflowRun = wfr_qs.first()
self.assertEqual("ctTSO500-L000002", db_wfr.workflow_run_name)
# We don't expect any library associations here!
self.assertEqual(0, db_wfr.libraries.count())
self.assertEqual(0, db_wfr.get_libraries().count())

def test_create_wrsc_library(self):
"""
Expand Down Expand Up @@ -116,8 +116,8 @@ def test_create_wrsc_library(self):
db_wfr: WorkflowRun = wfr_qs.first()
self.assertEqual("ctTSO500-L000002", db_wfr.workflow_run_name)
# We do expect 2 library associations here!
self.assertEqual(2, db_wfr.libraries.count())
for lib in db_wfr.libraries.all():
self.assertEqual(2, db_wfr.get_libraries().count())
for lib in db_wfr.get_libraries().all():
self.assertTrue(lib.library_id in library_ids)

def test_create_wrsc_library_exists(self):
Expand Down Expand Up @@ -184,8 +184,8 @@ def test_create_wrsc_library_exists(self):
db_wfr: WorkflowRun = wfr_qs.first()
self.assertEqual("ctTSO500-L000002", db_wfr.workflow_run_name)
# We do expect 2 library associations here!
self.assertEqual(2, db_wfr.libraries.count())
for lib in db_wfr.libraries.all():
self.assertEqual(2, db_wfr.get_libraries().count())
for lib in db_wfr.get_libraries().all():
self.assertTrue(lib.library_id in library_ids)

def test_get_last_state(self):
Expand Down

0 comments on commit 5fce7a7

Please sign in to comment.