コード例 #1
0
 def test_location_factory(self):
     location = Location.from_pickup_address(
         'Tenaya Hall, San Diego, CA 92161')
     location_dict = {
         'locationCategory': "user",
         'coordinates': {
             'latitude': 32.8794203,
             'longitude': -117.2428555
         },
         'address': 'Tenaya Hall, San Diego, CA 92161',
     }
     self.assertDictEqual(location.to_dict(), location_dict)
コード例 #2
0
 def testPickupAddress(self):
     location = Location.from_pickup_address(
         "Tenaya Hall, San Diego, CA 92161")
     d = location.to_dict()
     self.assertEqual(
         d, {
             'locationCategory': "user",
             'coordinates': {
                 'latitude': 32.8794203,
                 'longitude': -117.2428555
             },
             'address': 'Tenaya Hall, San Diego, CA 92161',
         })
コード例 #3
0
 def testGetUserLocation(self):
     location = Location.from_pickup_address(
         "Tenaya Hall, San Diego, CA 92161")
     ref = LocationGenericDao().insert_new(location)
     self.to_delete.append(ref)
     location = LocationGenericDao().get(ref)
     d = location.to_dict()
     self.assertEqual(
         d, {
             'locationCategory': "user",
             'coordinates': {
                 'latitude': 32.8794203,
                 'longitude': -117.2428555
             },
             'address': 'Tenaya Hall, San Diego, CA 92161',
         })