def test_is_between_longitudes_c(self):
        min_long = 100
        location_long = 170
        max_long = 150

        obj = MapObject(location_long=location_long)
        self.assertFalse(obj.is_between_longitudes(min_long=min_long, max_long=max_long))
    def test_is_between_longitudes_g(self):
        min_long = 45
        location_long = -120
        max_long = -160

        obj = MapObject(location_long=location_long)
        self.assertFalse(obj.is_between_longitudes(min_long=min_long, max_long=max_long))
    def test_is_between_latitudes_inside(self):
        min_lat = 30
        location_lat = 40
        max_lat = 50

        obj = MapObject(location_lat=location_lat)
        self.assertTrue(obj.is_between_latitudes(min_lat=min_lat, max_lat=max_lat))
    def test_is_between_latitudes_below(self):
        min_lat = 30
        location_lat = 10
        max_lat = 50

        obj = MapObject(location_lat=location_lat)
        self.assertFalse(obj.is_between_latitudes(min_lat=min_lat, max_lat=max_lat))
Beispiel #5
0
    def test_is_between_latitudes_above(self):
        min_lat = 30
        location_lat = 60
        max_lat = 50

        obj = MapObject(location_lat=location_lat)
        self.assertFalse(
            obj.is_between_latitudes(min_lat=min_lat, max_lat=max_lat))
Beispiel #6
0
    def test_is_between_longitudes_g(self):
        min_long = 45
        location_long = -120
        max_long = -160

        obj = MapObject(location_long=location_long)
        self.assertFalse(
            obj.is_between_longitudes(min_long=min_long, max_long=max_long))
Beispiel #7
0
    def test_is_between_longitudes_c(self):
        min_long = 100
        location_long = 170
        max_long = 150

        obj = MapObject(location_long=location_long)
        self.assertFalse(
            obj.is_between_longitudes(min_long=min_long, max_long=max_long))
Beispiel #8
0
    def test_is_between_latitudes_inside(self):
        min_lat = 30
        location_lat = 40
        max_lat = 50

        obj = MapObject(location_lat=location_lat)
        self.assertTrue(
            obj.is_between_latitudes(min_lat=min_lat, max_lat=max_lat))
 def test_are_valid_params_no_numeric(self):
     rect_params = {
         'min_lat': 'abcd',
         'max_lat': '40.0',
         'min_long': '80.0',
         'max_long': '90.0'
     }
     with self.assertRaises(ValidationError):
         MapObject.get_as_decimals(rect_params)
Beispiel #10
0
 def test_are_valid_params_no_numeric(self):
     rect_params = {
         'min_lat': 'abcd',
         'max_lat': '40.0',
         'min_long': '80.0',
         'max_long': '90.0'
     }
     with self.assertRaises(ValidationError):
         MapObject.get_as_decimals(rect_params)
    def test_are_valid_params_incomplete(self):

        rect_params = {
            'min_lat': None,
            'max_lat': '40.0',
            'min_long': '80.0',
            'max_long': '90.0'
        }
        with self.assertRaises(ValidationError):
            MapObject.get_as_decimals(rect_params)
Beispiel #12
0
    def test_are_valid_params_incomplete(self):

        rect_params = {
            'min_lat': None,
            'max_lat': '40.0',
            'min_long': '80.0',
            'max_long': '90.0'
        }
        with self.assertRaises(ValidationError):
            MapObject.get_as_decimals(rect_params)
    def test_are_valid_params(self):
        rect_params = {
            'min_lat': '30.0',
            'max_lat': '40.0',
            'min_long': '80.0',
            'max_long': '90.0'
        }

        rect_params_decimals = MapObject.get_as_decimals(rect_params)
        self.assertEqual(rect_params_decimals['min_lat'], 30.0)
        self.assertEqual(rect_params_decimals['max_lat'], 40.0)
        self.assertEqual(rect_params_decimals['min_long'], 80.0)
        self.assertEqual(rect_params_decimals['max_long'], 90.0)
Beispiel #14
0
    def test_are_valid_params(self):
        rect_params = {
            'min_lat': '30.0',
            'max_lat': '40.0',
            'min_long': '80.0',
            'max_long': '90.0'
        }

        rect_params_decimals = MapObject.get_as_decimals(rect_params)
        self.assertEqual(rect_params_decimals['min_lat'], 30.0)
        self.assertEqual(rect_params_decimals['max_lat'], 40.0)
        self.assertEqual(rect_params_decimals['min_long'], 80.0)
        self.assertEqual(rect_params_decimals['max_long'], 90.0)
Beispiel #15
0
 def test_is_valid_longitude_low_correct(self):
     longitude = -180
     self.assertTrue(MapObject.is_valid_longitude(longitude))
 def test_is_valid_latitude_low_correct(self):
     latitude = -90
     self.assertTrue(MapObject.is_valid_latitude(latitude))
 def test_is_valid_latitude_too_low(self):
     latitude = -91
     self.assertFalse(MapObject.is_valid_latitude(latitude))
 def test_is_valid_longitude_too_low(self):
     longitude = -181
     self.assertFalse(MapObject.is_valid_longitude(longitude))
Beispiel #19
0
 def test_is_valid_latitude_too_low(self):
     latitude = -91
     self.assertFalse(MapObject.is_valid_latitude(latitude))
Beispiel #20
0
 def test_representation(self):
     obj = MapObject(name='Test')
     self.assertEqual(repr(obj), '<MapObject Test>')
Beispiel #21
0
 def test_is_valid_longitude_too_low(self):
     longitude = -181
     self.assertFalse(MapObject.is_valid_longitude(longitude))
 def test_is_valid_longitude_low_correct(self):
     longitude = -180
     self.assertTrue(MapObject.is_valid_longitude(longitude))
Beispiel #23
0
 def test_string_representation(self):
     obj = MapObject(name='Test')
     self.assertEqual(str(obj), 'Test')
Beispiel #24
0
 def test_is_valid_latitude_low_correct(self):
     latitude = -90
     self.assertTrue(MapObject.is_valid_latitude(latitude))