Skip to content

Commit e5b3d10

Browse files
committed
Add test for GitHub #78
1 parent da42586 commit e5b3d10

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

tests/test_webservice.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ def test_200_with_email_hashing(self):
239239
json.loads(httpretty.last_request.body),
240240
)
241241

242+
# This was fixed in https://github.com/maxmind/minfraud-api-python/pull/78
242243
@httprettified
243244
def test_200_with_locales(self):
244245
locales = ("fr",)
@@ -252,6 +253,27 @@ def test_200_with_locales(self):
252253
self.assertEqual("Royaume-Uni", model.ip_address.country.name)
253254
self.assertEqual("Londres", model.ip_address.city.name)
254255

256+
@httprettified
257+
def test_200_with_reserved_ip_warning(self):
258+
model = self.create_success(
259+
"""
260+
{
261+
"risk_score": 12,
262+
"id": "0e52f5ac-7690-4780-a939-173cb13ecd75",
263+
"warnings": [
264+
{
265+
"code": "IP_ADDRESS_RESERVED",
266+
"warning":
267+
"The IP address supplied is in a reserved network.",
268+
"input_pointer": "/device/ip_address"
269+
}
270+
]
271+
}
272+
"""
273+
)
274+
275+
self.assertEqual(12, model.risk_score)
276+
255277
@httprettified
256278
def test_200_with_no_body(self):
257279
with self.assertRaisesRegex(

0 commit comments

Comments
 (0)