Ejemplo n.º 1
0
 def test_track(self):
     self.assertEqual(empty_track, self.s.get_track())
     self.s.receive(self.__message([Position(31, -42)]))
     self.assertEqual(
         empty_track._replace(
             latitude=TelemetryItem(31, _dummy_receive_time),
             longitude=TelemetryItem(-42, _dummy_receive_time),
         ), self.s.get_track())
Ejemplo n.º 2
0
 def test_init_from_partial_json(self):
     self.assertEqual(
         empty_track._replace(
             latitude=TelemetryItem(1, 1000),
             longitude=TelemetryItem(2, 1000)),
         Track({
             u'latitude': {u'value': 1, u'timestamp': 1000},
             u'longitude': {u'value': 2, u'timestamp': 1000},
         }))
Ejemplo n.º 3
0
 def test_track(self):
     self.assertEqual(empty_track, self.s.get_track())
     self.s.receive(self.__message([
         Position(31, -42)
     ]))
     self.assertEqual(empty_track._replace(
         latitude=TelemetryItem(31, _dummy_receive_time),
         longitude=TelemetryItem(-42, _dummy_receive_time),
     ), self.s.get_track())
Ejemplo n.º 4
0
 def test_init_from_partial_json(self):
     self.assertEquals(
         empty_track._replace(
             latitude=TelemetryItem(1, 1000),
             longitude=TelemetryItem(2, 1000)),
         Track({
             u'latitude': {u'value': 1, u'timestamp': 1000},
             u'longitude': {u'value': 2, u'timestamp': 1000},
         }))
Ejemplo n.º 5
0
 def __init__(self, latitude, longitude):
     self.__track = empty_track._replace(
         latitude=TelemetryItem(float(latitude), None),
         longitude=TelemetryItem(float(longitude), None))
Ejemplo n.º 6
0
 def test_init_from_partial_json(self):
     self.assertEquals(
         empty_track._replace(latitude=TelemetryItem(1, 1000), longitude=TelemetryItem(2, 1000)),
         Track({u"latitude": {u"value": 1, u"timestamp": 1000}, u"longitude": {u"value": 2, u"timestamp": 1000}}),
     )