From d15ed059335e95de2866f24695900f1412f037be Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Mon, 10 Dec 2018 13:13:01 -0500 Subject: [PATCH] Add test for breakage in ipresolver --- util/ipresolver/test/test_ipresolver.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/util/ipresolver/test/test_ipresolver.py b/util/ipresolver/test/test_ipresolver.py index 705df89a9..8bb786308 100644 --- a/util/ipresolver/test/test_ipresolver.py +++ b/util/ipresolver/test/test_ipresolver.py @@ -18,7 +18,12 @@ def aws_ip_range_data(): 'ip_prefix': '10.0.0.0/8', 'region': 'GLOBAL', 'service': 'AMAZON', - } + }, + { + 'ip_prefix': '6.0.0.0/8', + 'region': 'GLOBAL', + 'service': 'AMAZON', + }, ], } return fake_range_doc @@ -53,6 +58,7 @@ def test_resolved(aws_ip_range_data, test_ip_range_cache, test_aws_ip, app): with patch.dict('util.ipresolver.CACHE', test_ip_range_cache): assert ipresolver.resolve_ip(test_aws_ip) == ResolvedLocation(provider='aws', region=u'GLOBAL', service=None, sync_token=123456789, country_iso_code=None) assert ipresolver.resolve_ip('10.0.0.2') == ResolvedLocation(provider='aws', region=u'GLOBAL', service=None, sync_token=123456789, country_iso_code=None) + assert ipresolver.resolve_ip('6.0.0.2') == ResolvedLocation(provider='aws', region=u'GLOBAL', service=None, sync_token=123456789, country_iso_code=u'US') assert ipresolver.resolve_ip('1.2.3.4') == ResolvedLocation(provider='internet', region=u'NA', service=u'US', sync_token=123456789, country_iso_code=u'US') assert ipresolver.resolve_ip('127.0.0.1') == ResolvedLocation(provider='internet', region=None, service=None, sync_token=123456789, country_iso_code=None)