|
18 | 18 |
|
19 | 19 | from fingerprint_pro_server_api_sdk import (Configuration, ErrorResponse, ErrorPlainResponse, ErrorCode, |
20 | 20 | RawDeviceAttributes, EventsUpdateRequest, RelatedVisitorsResponse, |
21 | | - SearchEventsResponse, SearchEventsResponseEvents, Products) |
| 21 | + SearchEventsResponse, SearchEventsResponseEvents, Products, |
| 22 | + GeolocationSubdivisions, GeolocationSubdivision) |
22 | 23 | from fingerprint_pro_server_api_sdk.api.fingerprint_api import FingerprintApi # noqa: E501 |
23 | 24 | from fingerprint_pro_server_api_sdk.rest import KnownApiException, ApiException |
24 | 25 | from urllib.parse import urlencode |
@@ -274,6 +275,16 @@ def test_get_event_correct_data(self): |
274 | 275 | self.assertIsNone(event_response_dict["products"]["identification"]["data"]["last_seen_at"]["subscription"]) |
275 | 276 | self.assertIsInstance(event_response.products.raw_device_attributes.data, RawDeviceAttributes) |
276 | 277 |
|
| 278 | + subdivisions = event_response.products.identification.data.ip_location.subdivisions |
| 279 | + self.assertIsInstance(subdivisions, GeolocationSubdivisions) |
| 280 | + self.assertEqual(len(subdivisions), 1) |
| 281 | + self.assertIsInstance(subdivisions[0], GeolocationSubdivision) |
| 282 | + self.assertEqual(subdivisions[0].iso_code, "63") |
| 283 | + self.assertEqual(subdivisions[0].name, "North Rhine-Westphalia") |
| 284 | + self.assertEqual( |
| 285 | + event_response_dict["products"]["identification"]["data"]["ip_location"]["subdivisions"], |
| 286 | + [{"iso_code": "63", "name": "North Rhine-Westphalia"}]) |
| 287 | + |
277 | 288 | def test_get_event_errors_200(self): |
278 | 289 | """Test checks correct code run result in scenario of arrors in BotD or identification API""" |
279 | 290 | mock_pool = MockPoolManager(self) |
|
0 commit comments