diff options
Diffstat (limited to 'python-pytest-httpx.spec')
-rw-r--r-- | python-pytest-httpx.spec | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/python-pytest-httpx.spec b/python-pytest-httpx.spec index 2c0bf43..7508988 100644 --- a/python-pytest-httpx.spec +++ b/python-pytest-httpx.spec @@ -1,11 +1,11 @@ %global _empty_manifest_terminate_build 0 Name: python-pytest-httpx -Version: 0.21.3 +Version: 0.22.0 Release: 1 Summary: Send responses to httpx. License: MIT URL: https://colin-b.github.io/pytest_httpx/ -Source0: https://mirrors.nju.edu.cn/pypi/web/packages/13/53/0a8711ae619fcfd5ca1b526616ec8e65ef33e33d5eb4668a938db3d0b919/pytest_httpx-0.21.3.tar.gz +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/d1/eb/34228b57475c0f86829c8268e02a8fabd6ce9cf89bfaace7625949c80ee8/pytest_httpx-0.22.0.tar.gz BuildArch: noarch Requires: python3-httpx @@ -159,7 +159,7 @@ def test_head(httpx_mock: HTTPXMock): with httpx.Client() as client: response = client.head("https://test_url") - + ``` #### Matching on HTTP headers @@ -212,7 +212,7 @@ def test_json(httpx_mock: HTTPXMock): with httpx.Client() as client: assert client.get("https://test_url").json() == [{"key1": "value1", "key2": "value2"}] - + ``` Note that the `content-type` header will be set to `application/json` by default in the response. @@ -246,7 +246,7 @@ def test_bytes_body(httpx_mock: HTTPXMock): with httpx.Client() as client: assert client.get("https://test_url").content == b"This is my bytes content" - + ``` Use `html` parameter to reply with a custom body by providing UTF-8 encoded string. @@ -288,7 +288,7 @@ async def test_async_streaming(httpx_mock: HTTPXMock): async with httpx.AsyncClient() as client: async with client.stream(method="GET", url="https://test_url") as response: assert [part async for part in response.aiter_raw()] == [b"part 1", b"part 2"] - + ``` ### Add multipart response @@ -318,7 +318,7 @@ Content-Type: application/octet-stream\r content of file 1\r --2256d3a36d2a61a1eba35a22bee5c74a--\r ''' - + ``` ### Add non 200 response @@ -506,7 +506,7 @@ from pytest_httpx import HTTPXMock def test_exception_raising(httpx_mock: HTTPXMock): httpx_mock.add_exception(httpx.ReadTimeout("Unable to read within timeout")) - + with httpx.Client() as client: with pytest.raises(httpx.ReadTimeout): client.get("https://test_url") @@ -894,7 +894,7 @@ def test_head(httpx_mock: HTTPXMock): with httpx.Client() as client: response = client.head("https://test_url") - + ``` #### Matching on HTTP headers @@ -947,7 +947,7 @@ def test_json(httpx_mock: HTTPXMock): with httpx.Client() as client: assert client.get("https://test_url").json() == [{"key1": "value1", "key2": "value2"}] - + ``` Note that the `content-type` header will be set to `application/json` by default in the response. @@ -981,7 +981,7 @@ def test_bytes_body(httpx_mock: HTTPXMock): with httpx.Client() as client: assert client.get("https://test_url").content == b"This is my bytes content" - + ``` Use `html` parameter to reply with a custom body by providing UTF-8 encoded string. @@ -1023,7 +1023,7 @@ async def test_async_streaming(httpx_mock: HTTPXMock): async with httpx.AsyncClient() as client: async with client.stream(method="GET", url="https://test_url") as response: assert [part async for part in response.aiter_raw()] == [b"part 1", b"part 2"] - + ``` ### Add multipart response @@ -1053,7 +1053,7 @@ Content-Type: application/octet-stream\r content of file 1\r --2256d3a36d2a61a1eba35a22bee5c74a--\r ''' - + ``` ### Add non 200 response @@ -1241,7 +1241,7 @@ from pytest_httpx import HTTPXMock def test_exception_raising(httpx_mock: HTTPXMock): httpx_mock.add_exception(httpx.ReadTimeout("Unable to read within timeout")) - + with httpx.Client() as client: with pytest.raises(httpx.ReadTimeout): client.get("https://test_url") @@ -1626,7 +1626,7 @@ def test_head(httpx_mock: HTTPXMock): with httpx.Client() as client: response = client.head("https://test_url") - + ``` #### Matching on HTTP headers @@ -1679,7 +1679,7 @@ def test_json(httpx_mock: HTTPXMock): with httpx.Client() as client: assert client.get("https://test_url").json() == [{"key1": "value1", "key2": "value2"}] - + ``` Note that the `content-type` header will be set to `application/json` by default in the response. @@ -1713,7 +1713,7 @@ def test_bytes_body(httpx_mock: HTTPXMock): with httpx.Client() as client: assert client.get("https://test_url").content == b"This is my bytes content" - + ``` Use `html` parameter to reply with a custom body by providing UTF-8 encoded string. @@ -1755,7 +1755,7 @@ async def test_async_streaming(httpx_mock: HTTPXMock): async with httpx.AsyncClient() as client: async with client.stream(method="GET", url="https://test_url") as response: assert [part async for part in response.aiter_raw()] == [b"part 1", b"part 2"] - + ``` ### Add multipart response @@ -1785,7 +1785,7 @@ Content-Type: application/octet-stream\r content of file 1\r --2256d3a36d2a61a1eba35a22bee5c74a--\r ''' - + ``` ### Add non 200 response @@ -1973,7 +1973,7 @@ from pytest_httpx import HTTPXMock def test_exception_raising(httpx_mock: HTTPXMock): httpx_mock.add_exception(httpx.ReadTimeout("Unable to read within timeout")) - + with httpx.Client() as client: with pytest.raises(httpx.ReadTimeout): client.get("https://test_url") @@ -2210,7 +2210,7 @@ def test_response(httpx_mock): %prep -%autosetup -n pytest-httpx-0.21.3 +%autosetup -n pytest-httpx-0.22.0 %build %py3_build @@ -2250,5 +2250,5 @@ mv %{buildroot}/doclist.lst . %{_docdir}/* %changelog -* Fri Apr 07 2023 Python_Bot <Python_Bot@openeuler.org> - 0.21.3-1 +* Fri Apr 21 2023 Python_Bot <Python_Bot@openeuler.org> - 0.22.0-1 - Package Spec generated |