def test_iiterable_wraping(self): basic_pos1 = wdg.BasicGeoposition(47.1, -122.1, 0.0) basic_pos2 = wdg.BasicGeoposition(47.2, -122.2, 0.0) box = wdg.GeoboundingBox.TryCompute([basic_pos1, basic_pos2]) nw = box.NorthwestCorner se = box.SoutheastCorner self.assertAlmostEqual(nw.Latitude, basic_pos2.Latitude) self.assertAlmostEqual(nw.Longitude, basic_pos2.Longitude) self.assertAlmostEqual(se.Latitude, basic_pos1.Latitude) self.assertAlmostEqual(se.Longitude, basic_pos1.Longitude)
def test_struct_ctor(self): basic_pos = wdg.BasicGeoposition(Latitude=47.1, Longitude=-122.1, Altitude=0.0) self.assertEqual(basic_pos.Latitude, 47.1) self.assertEqual(basic_pos.Longitude, -122.1) self.assertEqual(basic_pos.Altitude, 0.0) geocircle = wdg.Geocircle(basic_pos, 10) center = geocircle.Center self.assertEqual(10, geocircle.Radius) for x in ["Latitude", "Longitude", "Altitude"]: self.assertEqual(getattr(basic_pos, x), getattr(center, x))