From c168413a8efb8fecd74f3bed2932061102842d96 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Thu, 30 Nov 2017 10:23:58 -0500 Subject: [PATCH] Fix bug when running ipresolver under Gitlab CI Since the container does contain IP data, this would fail --- util/ipresolver/test/test_ipresolver.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/util/ipresolver/test/test_ipresolver.py b/util/ipresolver/test/test_ipresolver.py index 26e78d7fc..d5b604a8c 100644 --- a/util/ipresolver/test/test_ipresolver.py +++ b/util/ipresolver/test/test_ipresolver.py @@ -25,9 +25,14 @@ def aws_ip_range_data(): def test_unstarted(app, test_aws_ip): ipresolver = IPResolver(app) - assert ipresolver.resolve_ip(test_aws_ip) is None -def test_resolved(aws_ip_range_data, test_aws_ip, app,): + def get_data(): + return None + + with patch.object(ipresolver, '_get_aws_ip_ranges', get_data): + assert ipresolver.resolve_ip(test_aws_ip) is None + +def test_resolved(aws_ip_range_data, test_aws_ip, app): ipresolver = IPResolver(app) def get_data():