summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-04-21 07:53:34 +0000
committerCoprDistGit <infra@openeuler.org>2023-04-21 07:53:34 +0000
commita3ddad53f25bab804c78783447dbe6869f377cb0 (patch)
tree302771b3263560c26d6955fdbb6b5a8c87a16d41
parent4cd1dd73850b65700978d088514b6e177c6936ab (diff)
automatic import of python-pytest-httpxopeneuler20.03
-rw-r--r--.gitignore1
-rw-r--r--python-pytest-httpx.spec44
-rw-r--r--sources2
3 files changed, 24 insertions, 23 deletions
diff --git a/.gitignore b/.gitignore
index dc916bb..f0a2815 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
/pytest_httpx-0.21.3.tar.gz
+/pytest_httpx-0.22.0.tar.gz
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
diff --git a/sources b/sources
index afc7f6f..2268e0c 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-63b25a691f054b1dc718ff4d219a7a23 pytest_httpx-0.21.3.tar.gz
+f784266f25000200ad8f87291c169138 pytest_httpx-0.22.0.tar.gz