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