Ejemplo n.º 1
0
def test_invalid_http_version_list_type():
    with pytest.raises(ValueError):
        httpx.HTTPVersionConfig([123])
Ejemplo n.º 2
0
def test_empty_http_version():
    with pytest.raises(ValueError):
        httpx.HTTPVersionConfig([])
Ejemplo n.º 3
0
def test_invalid_http_version_type():
    with pytest.raises(TypeError):
        httpx.HTTPVersionConfig(123)
Ejemplo n.º 4
0
def test_invalid_http_version():
    with pytest.raises(ValueError):
        httpx.HTTPVersionConfig("HTTP/9")
Ejemplo n.º 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'])"
Ejemplo n.º 6
0
def test_http_versions_from_list():
    http_versions = httpx.HTTPVersionConfig(["http/1.1"])
    assert repr(http_versions) == "HTTPVersionConfig(['HTTP/1.1'])"
Ejemplo n.º 7
0
def test_http_versions_repr():
    http_versions = httpx.HTTPVersionConfig()
    assert repr(http_versions) == "HTTPVersionConfig(['HTTP/1.1', 'HTTP/2'])"