Home / Function/ test_should_bypass_proxies_win_registry_bad_values() — requests Function Reference

test_should_bypass_proxies_win_registry_bad_values() — requests Function Reference

Architecture documentation for the test_should_bypass_proxies_win_registry_bad_values() function in test_utils.py from the requests codebase.

Entity Profile

Dependency Diagram

graph TD
  fe06f28c_b4f1_1a20_7721_1561c6e10eee["test_should_bypass_proxies_win_registry_bad_values()"]
  5828793e_be5b_8952_37f1_338fd4634a1a["test_utils.py"]
  fe06f28c_b4f1_1a20_7721_1561c6e10eee -->|defined in| 5828793e_be5b_8952_37f1_338fd4634a1a
  1d6ec2dc_3200_1695_ca5e_059140ad2747["Close()"]
  fe06f28c_b4f1_1a20_7721_1561c6e10eee -->|calls| 1d6ec2dc_3200_1695_ca5e_059140ad2747
  style fe06f28c_b4f1_1a20_7721_1561c6e10eee fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_utils.py lines 888–917

def test_should_bypass_proxies_win_registry_bad_values(monkeypatch):
    """Tests for function should_bypass_proxies to check if proxy
    can be bypassed or not with Windows invalid registry settings.
    """
    import winreg

    class RegHandle:
        def Close(self):
            pass

    ie_settings = RegHandle()

    def OpenKey(key, subkey):
        return ie_settings

    def QueryValueEx(key, value_name):
        if key is ie_settings:
            if value_name == "ProxyEnable":
                # Invalid response; Should be an int or int-y value
                return [""]
            elif value_name == "ProxyOverride":
                return ["192.168.*;127.0.0.1;localhost.localdomain;172.16.1.1"]

    monkeypatch.setenv("http_proxy", "")
    monkeypatch.setenv("https_proxy", "")
    monkeypatch.setenv("no_proxy", "")
    monkeypatch.setenv("NO_PROXY", "")
    monkeypatch.setattr(winreg, "OpenKey", OpenKey)
    monkeypatch.setattr(winreg, "QueryValueEx", QueryValueEx)
    assert should_bypass_proxies("http://172.16.1.1/", None) is False

Domain

Subdomains

Defined In

Calls

Frequently Asked Questions

What does test_should_bypass_proxies_win_registry_bad_values() do?
test_should_bypass_proxies_win_registry_bad_values() is a function in the requests codebase, defined in tests/test_utils.py.
Where is test_should_bypass_proxies_win_registry_bad_values() defined?
test_should_bypass_proxies_win_registry_bad_values() is defined in tests/test_utils.py at line 888.
What does test_should_bypass_proxies_win_registry_bad_values() call?
test_should_bypass_proxies_win_registry_bad_values() calls 1 function(s): Close.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free