Exemplo n.º 1
0
 def test_shared(self):
     """
     Tests availibility of shared values between the METAR and TAF translations
     """
     units = structs.Units(**static.NA_UNITS)
     data = structs.SharedData(altimeter=core.make_number('2992'),
                               clouds=[core.make_cloud('OVC060')],
                               flight_rules='',
                               other=['RA'],
                               sanitized='',
                               visibility=core.make_number('10'),
                               wind_direction=core.make_number('0'),
                               wind_gust=core.make_number('0'),
                               wind_speed=core.make_number('0'))
     trans = translate.shared(data, units)
     self.assertIsInstance(trans, dict)
     for key in ('altimeter', 'clouds', 'other', 'visibility'):
         self.assertIn(key, trans)
         self.assertTrue(bool(trans[key]))
Exemplo n.º 2
0
 def test_shared(self):
     """Tests availability of shared values between the METAR and TAF translations"""
     units = structs.Units(**static.core.NA_UNITS)
     data = structs.SharedData(
         altimeter=core.make_number("2992"),
         clouds=[core.make_cloud("OVC060")],
         flight_rules="",
         other=[],
         sanitized="",
         visibility=core.make_number("10"),
         wind_direction=core.make_number("0"),
         wind_gust=core.make_number("0"),
         wind_speed=core.make_number("0"),
         wx_codes=get_wx_codes(["RA"])[1],
     )
     trans = translate.base.current_shared(data, units)
     self.assertIsInstance(trans, dict)
     for key in ("altimeter", "clouds", "visibility", "wx_codes"):
         self.assertIn(key, trans)
         self.assertTrue(bool(trans[key]))