Closed jklynch closed 4 years ago
The initial commit adds a test to demonstrate the bug, but the test may not be quite right yet. At least it fails!
An elegant test.
I agree we are overdue for splitting up the event-model tests across more than more file. Would you mind moving this embarrassingly monolithic "unit test" into the new file as part of this PR, so we can keep the RunRouter tests together?
I confirmed that running the test in its final (fixed) form against the master
branch version of event-model, I can reproduce the expected bug:
> assert subfactory_documents["start"] == [run_bundle.start_doc]
E AssertionError: assert [{'configurat...rimary', ...}] == [{'time': 158...742a544daa0'}]
This PR addresses #170.
Description
Added field
self._start_to_start_doc
toRunRouter
. InRunRouter.start(...)
store the start document by uid. InRunRouter.descriptor(...)
retrieve the associated start document and give it to subfactory callbacks. InRunRouter.stop(...)
remove the start document fromself._start_to_start_doc
.How Has This Been Tested?
The test function
test_subfactory()
intest_run_router.py
was written to target the bug reported in #170.The test function
test_run_router()
has been moved fromtest_em.py
totest_run_router.py
to keepRunRouter
tests together.