-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DM-40948: Add TMA eventMaker function for getting a specific event #63
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -321,10 +321,13 @@ def test_endToEnd(self): | |
def test_noDataBehaviour(self): | ||
eventMaker = self.tmaEventMaker | ||
noDataDayObs = 19500101 # do not use 19700101 - there is data for that day! | ||
with self.assertWarns(Warning, msg=f"No EFD data found for dayObs={noDataDayObs}"): | ||
with self.assertLogs(level='WARNING') as cm: | ||
correctMsg = f"No EFD data found for dayObs={noDataDayObs}" | ||
events = eventMaker.getEvents(noDataDayObs) | ||
self.assertIsInstance(events, list) | ||
self.assertEqual(len(events), 0) | ||
msg = cm.output[0] | ||
self.assertIn(correctMsg, msg) | ||
|
||
@vcr.use_cassette() | ||
def test_helperFunctions(self): | ||
|
@@ -338,6 +341,25 @@ def test_helperFunctions(self): | |
self.assertEqual(slews, foundSlews) | ||
self.assertEqual(tracks, foundTracks) | ||
|
||
@vcr.use_cassette() | ||
def test_getEvent(self): | ||
# test the singular event getter, and what happens if the event doesn't | ||
# exist for the day | ||
eventMaker = self.tmaEventMaker | ||
events = eventMaker.getEvents(self.dayObs) | ||
nEvents = len(events) | ||
|
||
event = eventMaker.getEvent(self.dayObs, 0) | ||
self.assertIsInstance(event, TMAEvent) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure if the API supports it, but could you add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, it looks like past-Merlin actually did implement |
||
event = eventMaker.getEvent(self.dayObs, 100) | ||
self.assertIsInstance(event, TMAEvent) | ||
|
||
with self.assertLogs(level='WARNING') as cm: | ||
correctMsg = f"Event {nEvents+1} not found for {self.dayObs}" | ||
event = eventMaker.getEvent(self.dayObs, nEvents+1) | ||
msg = cm.output[0] | ||
self.assertIn(correctMsg, msg) | ||
|
||
@vcr.use_cassette() | ||
def test_printing(self): | ||
eventMaker = self.tmaEventMaker | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And actually, might even just be
None
I'm fuzzy on the different use cases for single vs double `.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, that was supposed to be a single-backquoted None. Not sure how to invoke that with github markdown...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am equally fuzzy 😬 We can certainly both agree that three/one isn't the right format though 😛