|
@@ -9,7 +9,7 @@ from django.core.exceptions import SuspiciousOperation
|
|
|
from urllib3.util.connection import HAS_IPV6
|
|
|
|
|
|
from sentry import http
|
|
|
-from sentry.testutils.helpers import override_blacklist
|
|
|
+from sentry.testutils.helpers import override_blocklist
|
|
|
|
|
|
|
|
|
@responses.activate
|
|
@@ -27,7 +27,7 @@ def test_simple(mock_getaddrinfo):
|
|
|
assert "gzip" in request.headers.get("Accept-Encoding", "")
|
|
|
|
|
|
|
|
|
-@override_blacklist("127.0.0.1", "::1", "10.0.0.0/8")
|
|
|
+@override_blocklist("127.0.0.1", "::1", "10.0.0.0/8")
|
|
|
# XXX(dcramer): we can't use responses here as it hooks Session.send
|
|
|
# @responses.activate
|
|
|
def test_ip_blacklist_ipv4():
|
|
@@ -41,14 +41,14 @@ def test_ip_blacklist_ipv4():
|
|
|
|
|
|
|
|
|
@pytest.mark.skipif(not HAS_IPV6, reason="needs ipv6")
|
|
|
-@override_blacklist("::1")
|
|
|
+@override_blocklist("::1")
|
|
|
def test_ip_blacklist_ipv6():
|
|
|
with pytest.raises(SuspiciousOperation):
|
|
|
http.safe_urlopen("http://[::1]")
|
|
|
|
|
|
|
|
|
@pytest.mark.skipif(HAS_IPV6, reason="stub for non-ipv6 systems")
|
|
|
-@override_blacklist("::1")
|
|
|
+@override_blocklist("::1")
|
|
|
@patch("socket.getaddrinfo")
|
|
|
def test_ip_blacklist_ipv6_fallback(mock_getaddrinfo):
|
|
|
mock_getaddrinfo.return_value = [(10, 1, 6, "", ("::1", 0, 0, 0))]
|
|
@@ -59,7 +59,7 @@ def test_ip_blacklist_ipv6_fallback(mock_getaddrinfo):
|
|
|
@pytest.mark.skipif(
|
|
|
platform.system() == "Darwin", reason="macOS is always broken, see comment in sentry/http.py"
|
|
|
)
|
|
|
-@override_blacklist("127.0.0.1")
|
|
|
+@override_blocklist("127.0.0.1")
|
|
|
def test_garbage_ip():
|
|
|
with pytest.raises(SuspiciousOperation):
|
|
|
# '0177.0000.0000.0001' is an octal for '127.0.0.1'
|