def setUp(self): self.s = APRSStation('TEST')
class TestAPRSStation(unittest.TestCase): def setUp(self): self.s = APRSStation('TEST') def __message(self, facts): return APRSMessage(receive_time=_dummy_receive_time, source='', destination='', via='', payload='', facts=facts, errors=[], comment='') def test_address(self): self.assertEqual(self.s.get_address(), 'TEST') def test_track(self): self.assertEqual(empty_track, self.s.get_track()) self.s.receive( self.__message([ Position(31, -42), Altitude(1000, True), ])) self.assertEqual( empty_track._replace( latitude=TelemetryItem(31, _dummy_receive_time), longitude=TelemetryItem(-42, _dummy_receive_time), altitude=TelemetryItem(304.8, _dummy_receive_time)), self.s.get_track()) def test_symbol(self): self.assertEqual('', self.s.get_symbol()) self.s.receive(self.__message([Symbol('/=')])) self.assertEqual('/=', self.s.get_symbol()) def test_status(self): self.assertEqual('', self.s.get_status()) self.s.receive(self.__message([Status('foo')])) self.assertEqual('foo', self.s.get_status())
class TestAPRSStation(unittest.TestCase): def setUp(self): self.s = APRSStation('TEST') def __message(self, facts): return APRSMessage( receive_time=_dummy_receive_time, source='', destination='', via='', payload='', facts=facts, errors=[], comment='') def test_address(self): self.assertEqual(self.s.get_address(), 'TEST') def test_position(self): self.assertEqual(None, self.s.get_position()) self.s.receive(self.__message([ Position(31, -42) ])) self.assertEqual((31, -42, _dummy_receive_time), self.s.get_position()) def test_symbol(self): self.assertEqual(None, self.s.get_symbol()) self.s.receive(self.__message([ Symbol('/=') ])) self.assertEqual('/=', self.s.get_symbol()) def test_status(self): self.assertEqual('', self.s.get_status()) self.s.receive(self.__message([ Status('foo') ])) self.assertEqual('foo', self.s.get_status())
class TestAPRSStation(unittest.TestCase): def setUp(self): self.s = APRSStation('TEST') def __message(self, facts): return APRSMessage( receive_time=_dummy_receive_time, source='', destination='', via='', payload='', facts=facts, errors=[], comment='') def test_address(self): self.assertEqual(self.s.get_address(), 'TEST') def test_track(self): self.assertEqual(empty_track, self.s.get_track()) self.s.receive(self.__message([ Position(31, -42), Altitude(1000, True), ])) self.assertEqual(empty_track._replace( latitude=TelemetryItem(31, _dummy_receive_time), longitude=TelemetryItem(-42, _dummy_receive_time), altitude=TelemetryItem(304.8, _dummy_receive_time) ), self.s.get_track()) def test_symbol(self): self.assertEqual(None, self.s.get_symbol()) self.s.receive(self.__message([ Symbol('/=') ])) self.assertEqual('/=', self.s.get_symbol()) def test_status(self): self.assertEqual('', self.s.get_status()) self.s.receive(self.__message([ Status('foo') ])) self.assertEqual('foo', self.s.get_status())
class TestAPRSStation(unittest.TestCase): def setUp(self): self.s = APRSStation('TEST') def __message(self, facts): return APRSMessage(receive_time=_dummy_receive_time, source='', destination='', via='', payload='', facts=facts, errors=[], comment='') def test_address(self): self.assertEqual(self.s.get_address(), 'TEST') def test_position(self): self.assertEqual(None, self.s.get_position()) self.s.receive(self.__message([Position(31, -42)])) self.assertEqual((31, -42, _dummy_receive_time), self.s.get_position()) def test_symbol(self): self.assertEqual(None, self.s.get_symbol()) self.s.receive(self.__message([Symbol('/=')])) self.assertEqual('/=', self.s.get_symbol()) def test_status(self): self.assertEqual('', self.s.get_status()) self.s.receive(self.__message([Status('foo')])) self.assertEqual('foo', self.s.get_status())