Example #1
0
def test_invalid_http_version_list_type():
    with pytest.raises(ValueError):
        httpx.HTTPVersionConfig([123])
Example #2
0
def test_empty_http_version():
    with pytest.raises(ValueError):
        httpx.HTTPVersionConfig([])
Example #3
0
def test_invalid_http_version_type():
    with pytest.raises(TypeError):
        httpx.HTTPVersionConfig(123)
Example #4
0
def test_invalid_http_version():
    with pytest.raises(ValueError):
        httpx.HTTPVersionConfig("HTTP/9")
Example #5
0
def test_http_versions_from_config():
    http_versions = httpx.HTTPVersionConfig(
        httpx.HTTPVersionConfig("HTTP/1.1"))
    assert repr(http_versions) == "HTTPVersionConfig(['HTTP/1.1'])"
Example #6
0
def test_http_versions_from_list():
    http_versions = httpx.HTTPVersionConfig(["http/1.1"])
    assert repr(http_versions) == "HTTPVersionConfig(['HTTP/1.1'])"
Example #7
0
def test_http_versions_repr():
    http_versions = httpx.HTTPVersionConfig()
    assert repr(http_versions) == "HTTPVersionConfig(['HTTP/1.1', 'HTTP/2'])"