def test_read_tle(self): db = sources.EtcTLESource(self.filename) tle = db._get_tle(SATE_ID, datetime.datetime.now()) self.assertEqual(tle, SAMPLE_TLE)
def test_wrong_sate(self): db = sources.EtcTLESource(self.filename) with self.assertRaises(LookupError): db._get_tle("fake_id", datetime.datetime.now())
def test_add_tle(self): db = sources.EtcTLESource(self.filename) db.add_tle(SATE_ID, SAMPLE_TLE2, dt.datetime.utcnow()) tle = db._get_tle(SATE_ID, dt.datetime.utcnow()) self.assertEqual(tle, SAMPLE_TLE2)