Coverage for tests/testUnscheduledDowntimeData.py : 34%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
self.th = Time('2020-01-01', format='isot', scale='tai') self.startofnight = -0.34 self.seed = 1516231120 self.survey_length = 3650*2
downtimeData = UnscheduledDowntimeData(self.th, start_of_night_offset=self.startofnight, survey_length=self.survey_length, seed=self.seed) self.assertEqual(downtimeData.seed, self.seed) self.assertEqual(downtimeData.survey_length, self.survey_length) self.assertEqual(self.th + TimeDelta(self.startofnight, format='jd'), downtimeData.night0) downtimeData = UnscheduledDowntimeData(self.th, start_of_night_offset=0, survey_length=self.survey_length, seed=self.seed) self.assertEqual(downtimeData.night0, self.th)
downtimeData = UnscheduledDowntimeData(self.th, start_of_night_offset=self.startofnight, survey_length=self.survey_length, seed=self.seed) downtimeData.make_data() self.assertEqual(len(downtimeData.downtime), 155) # Check some of the downtime values. dnight = downtimeData.downtime['end'] - downtimeData.downtime['start'] self.assertEqual(dnight[0].jd, 1) self.assertEqual(downtimeData.downtime['activity'][0], 'minor event') self.assertEqual(dnight[2].jd, 7) self.assertEqual(downtimeData.downtime['activity'][2], 'major event')
downtimeData = UnscheduledDowntimeData(self.th, start_of_night_offset=self.startofnight, survey_length=self.survey_length, seed=3) downtimeData.make_data() self.assertEqual(len(downtimeData.downtime), 145)
downtimeData = UnscheduledDowntimeData(self.th, start_of_night_offset=self.startofnight, survey_length=self.survey_length, seed=self.seed) downtimeData.make_data() downtimes = downtimeData() self.assertEqual(downtimes['activity'][2], 'major event')
lsst.utils.tests.init()
lsst.utils.tests.init() unittest.main() |