Skip to content

Commit f493f97

Browse files
committed
Fixed bug in longitude and metro_code caused by a missing comma. Closes #1.
1 parent ed119ea commit f493f97

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

geoip2/records.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ class Location(Record):
297297
:type: unicode
298298
299299
"""
300-
_valid_attributes = set(['accuracy_radius', 'latitude', 'longitude'
300+
_valid_attributes = set(['accuracy_radius', 'latitude', 'longitude',
301301
'metro_code', 'postal_code', 'postal_confidence',
302302
'time_zone'])
303303

tests/models_test.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,19 @@ def test_omni_full(self):
119119
self.assertEqual(model.subdivisions[1].name, 'Hennepin',
120120
'div 2 has correct name')
121121
self.assertEqual(model.subdivisions.most_specific.iso_code, 'HP',
122-
'subdivisions.most_specific returns HP')
122+
'subdivisions.most_specific returns HP')
123123
self.assertEqual(model.represented_country.name,
124124
'United Kingdom',
125125
'represented_country name is correct')
126126
self.assertEqual(model.represented_country.type,
127127
'military',
128128
'represented_country type is correct')
129-
129+
self.assertEqual(model.location.latitude, 44.98,
130+
'correct latitude')
131+
self.assertEqual(model.location.longitude, 93.2636,
132+
'correct longitude')
133+
self.assertEqual(model.location.metro_code, 765,
134+
'correct metro_code')
130135

131136
def test_omni_min(self):
132137
model = geoip2.models.Omni({'traits': {'ip_address': '5.6.7.8'}})

0 commit comments

Comments
 (0)