httpperf 1.0rc1__tar.gz → 1.0rc2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {httpperf-1.0rc1 → httpperf-1.0rc2}/NOTICE +54 -0
- {httpperf-1.0rc1/httpperf.egg-info → httpperf-1.0rc2}/PKG-INFO +14 -8
- {httpperf-1.0rc1 → httpperf-1.0rc2}/README.md +13 -7
- {httpperf-1.0rc1 → httpperf-1.0rc2}/httpperf/__init__.py +55 -10
- httpperf-1.0rc2/httpperf/version.py +1 -0
- {httpperf-1.0rc1 → httpperf-1.0rc2/httpperf.egg-info}/PKG-INFO +14 -8
- {httpperf-1.0rc1 → httpperf-1.0rc2}/httpperf.egg-info/SOURCES.txt +1 -0
- {httpperf-1.0rc1 → httpperf-1.0rc2}/src/httpperf.c +9 -3
- httpperf-1.0rc2/tests/test_api.py +542 -0
- {httpperf-1.0rc1 → httpperf-1.0rc2}/tests/test_engine.py +40 -0
- {httpperf-1.0rc1 → httpperf-1.0rc2}/tests/test_httpbin.py +5 -4
- httpperf-1.0rc1/httpperf/version.py +0 -1
- {httpperf-1.0rc1 → httpperf-1.0rc2}/LICENSE +0 -0
- {httpperf-1.0rc1 → httpperf-1.0rc2}/MANIFEST.in +0 -0
- {httpperf-1.0rc1 → httpperf-1.0rc2}/httpperf.egg-info/dependency_links.txt +0 -0
- {httpperf-1.0rc1 → httpperf-1.0rc2}/httpperf.egg-info/top_level.txt +0 -0
- {httpperf-1.0rc1 → httpperf-1.0rc2}/pyproject.toml +0 -0
- {httpperf-1.0rc1 → httpperf-1.0rc2}/setup.cfg +0 -0
- {httpperf-1.0rc1 → httpperf-1.0rc2}/setup.py +0 -0
- {httpperf-1.0rc1 → httpperf-1.0rc2}/src/ae/.clang-format +0 -0
- {httpperf-1.0rc1 → httpperf-1.0rc2}/src/ae/ae.c +0 -0
- {httpperf-1.0rc1 → httpperf-1.0rc2}/src/ae/ae.h +0 -0
- {httpperf-1.0rc1 → httpperf-1.0rc2}/src/ae/ae_epoll.c +0 -0
- {httpperf-1.0rc1 → httpperf-1.0rc2}/src/ae/ae_evport.c +0 -0
- {httpperf-1.0rc1 → httpperf-1.0rc2}/src/ae/ae_kqueue.c +0 -0
- {httpperf-1.0rc1 → httpperf-1.0rc2}/src/ae/ae_select.c +0 -0
- {httpperf-1.0rc1 → httpperf-1.0rc2}/src/ae/atomicvar.h +0 -0
- {httpperf-1.0rc1 → httpperf-1.0rc2}/src/ae/config.h +0 -0
- {httpperf-1.0rc1 → httpperf-1.0rc2}/src/ae/zmalloc.c +0 -0
- {httpperf-1.0rc1 → httpperf-1.0rc2}/src/ae/zmalloc.h +0 -0
- {httpperf-1.0rc1 → httpperf-1.0rc2}/tests/test_connections.py +0 -0
- {httpperf-1.0rc1 → httpperf-1.0rc2}/tests/test_cookie.py +0 -0
- {httpperf-1.0rc1 → httpperf-1.0rc2}/tests/test_http_versions.py +0 -0
- {httpperf-1.0rc1 → httpperf-1.0rc2}/tests/test_leaks.py +0 -0
- {httpperf-1.0rc1 → httpperf-1.0rc2}/tests/test_response.py +0 -0
- {httpperf-1.0rc1 → httpperf-1.0rc2}/tests/test_tls.py +0 -0
|
@@ -105,6 +105,60 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
|
105
105
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
106
106
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
107
107
|
|
|
108
|
+
=========================================================================
|
|
109
|
+
== nghttp3 Notice (bundled in binary wheels) ==
|
|
110
|
+
=========================================================================
|
|
111
|
+
|
|
112
|
+
The MIT License
|
|
113
|
+
|
|
114
|
+
Copyright (c) 2019 nghttp3 contributors
|
|
115
|
+
|
|
116
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
117
|
+
a copy of this software and associated documentation files (the
|
|
118
|
+
"Software"), to deal in the Software without restriction, including
|
|
119
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
120
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
121
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
122
|
+
the following conditions:
|
|
123
|
+
|
|
124
|
+
The above copyright notice and this permission notice shall be
|
|
125
|
+
included in all copies or substantial portions of the Software.
|
|
126
|
+
|
|
127
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
128
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
129
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
130
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
131
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
132
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
133
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
134
|
+
|
|
135
|
+
=========================================================================
|
|
136
|
+
== ngtcp2 Notice (bundled in binary wheels) ==
|
|
137
|
+
=========================================================================
|
|
138
|
+
|
|
139
|
+
The MIT License
|
|
140
|
+
|
|
141
|
+
Copyright (c) 2016 ngtcp2 contributors
|
|
142
|
+
|
|
143
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
144
|
+
a copy of this software and associated documentation files (the
|
|
145
|
+
"Software"), to deal in the Software without restriction, including
|
|
146
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
147
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
148
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
149
|
+
the following conditions:
|
|
150
|
+
|
|
151
|
+
The above copyright notice and this permission notice shall be
|
|
152
|
+
included in all copies or substantial portions of the Software.
|
|
153
|
+
|
|
154
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
155
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
156
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
157
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
158
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
159
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
160
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
161
|
+
|
|
108
162
|
=========================================================================
|
|
109
163
|
== OpenSSL Notice (bundled in binary wheels) ==
|
|
110
164
|
=========================================================================
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: httpperf
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.0rc2
|
|
4
4
|
Summary: An asyncio HTTP client for load testing, built on libcurl.
|
|
5
5
|
Author-email: Tony Simpson <agjasimpson@gmail.com>
|
|
6
6
|
Project-URL: Source, https://github.com/tonysimpson/httpperf
|
|
@@ -28,8 +28,6 @@ Dynamic: license-file
|
|
|
28
28
|
|
|
29
29
|
An asyncio HTTP client for load testing, built on libcurl.
|
|
30
30
|
|
|
31
|
-
httpperf was called acurl until version 1.0.
|
|
32
|
-
|
|
33
31
|
## Design
|
|
34
32
|
|
|
35
33
|
A load-testing client has three jobs: drive as much load as possible from each machine, report the server's response times rather than time spent waiting on the client, and read responses promptly so the server never sees a slow reader. httpperf is built around these.
|
|
@@ -52,15 +50,23 @@ Bytes are read off the wire as they arrive, whatever Python is doing. If Python
|
|
|
52
50
|
pip install httpperf
|
|
53
51
|
```
|
|
54
52
|
|
|
55
|
-
Wheels are published for Linux on x86_64 and aarch64, for Python 3.9 to 3.15, with glibc 2.34 or later (Ubuntu 22.04, Debian 12, RHEL 9 and later) or musl (Alpine). They include their own libcurl, with HTTP/2
|
|
53
|
+
Wheels are published for Linux on x86_64 and aarch64, for Python 3.9 to 3.15, with glibc 2.34 or later (Ubuntu 22.04, Debian 12, RHEL 9 and later) or musl (Alpine). They include their own libcurl, with HTTP/2 and HTTP/3.
|
|
56
54
|
|
|
57
|
-
Anywhere else, including Python 3.8, pip builds from source against the system's libcurl, which needs its development headers and a C compiler. That libcurl decides whether HTTP/3 is available.
|
|
55
|
+
Anywhere else, including Python 3.8, pip builds from source against the system's libcurl, which needs its development headers and a C compiler. That libcurl decides whether HTTP/3 is available: `curl -V` lists `HTTP3` under Features when it does.
|
|
58
56
|
|
|
59
57
|
```sh
|
|
60
58
|
sudo apt install libcurl4-openssl-dev # Debian/Ubuntu
|
|
61
59
|
pip install httpperf
|
|
62
60
|
```
|
|
63
61
|
|
|
62
|
+
To build against your own libcurl even where a wheel exists, skip the wheel, point the build at it and make sure it is found at run time:
|
|
63
|
+
|
|
64
|
+
```sh
|
|
65
|
+
CFLAGS=-I$PREFIX/include LDFLAGS="-L$PREFIX/lib -Wl,-rpath,$PREFIX/lib" pip install --no-binary httpperf httpperf
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
A session with `http_version="HTTP/3"` raises `ValueError` if the libcurl in use lacks HTTP/3.
|
|
69
|
+
|
|
64
70
|
## Quick start
|
|
65
71
|
|
|
66
72
|
```python
|
|
@@ -97,7 +103,7 @@ All arguments are keyword-only. A session can be created anywhere, even outside
|
|
|
97
103
|
| `max_host_connections` | `0` | Per-session cap on connections per host. Needs `connections="session"` or `"none"`. |
|
|
98
104
|
| `max_connections` | `0` | Per-session cap on connections in use. Needs `connections="session"` or `"none"`. |
|
|
99
105
|
| `cert` | `None` | `(certfile, keyfile)` paths for a client certificate, used by every request unless the request overrides it. |
|
|
100
|
-
| `timeout` | `None` | Seconds allowed for each request, from the start of the transfer to the last byte (each redirect hop separately). `None` or 0 means no limit. |
|
|
106
|
+
| `timeout` | `None` | Seconds allowed for each request, from the start of the transfer to the last byte (each redirect hop separately). `None` or 0 means no limit. Prefer this to `asyncio.wait_for` or cancelling the task: a cancelled request still runs to the end in curl and holds its connection until then, while a timeout stops it. |
|
|
101
107
|
| `connect_timeout` | `None` | Seconds allowed to connect, TLS included. `None` means curl's default of 300 s. |
|
|
102
108
|
| `verify` | `False` | Server certificate checking. `False`: none, as most load tests want. `True`: check against the system CA bundle: `SSL_CERT_FILE` if set, otherwise libcurl's own default, or the usual system locations if it has none. A path: check against that CA bundle. Requests can override it. |
|
|
103
109
|
| `json_dumps` | `None` | Function that turns a `json=` argument into the request body (`str` or `bytes`). `None` means the engine's. |
|
|
@@ -143,7 +149,7 @@ An engine binds to the asyncio loop running when it is first used, and so does a
|
|
|
143
149
|
| `cookies` | Dict of cookies to send with this request (added to the session jar). |
|
|
144
150
|
| `cookie_list` | List of `Cookie` objects. |
|
|
145
151
|
| `auth` | `(username, password)` for basic auth. |
|
|
146
|
-
| `data` | Request body: `str` or `bytes` as is, or a dict or list of pairs, form-encoded with `Content-Type: application/x-www-form-urlencoded` unless you set it. |
|
|
152
|
+
| `data` | Request body: `str` or `bytes` as is, with no `Content-Type` unless you set one, or a dict or list of pairs, form-encoded with `Content-Type: application/x-www-form-urlencoded` unless you set it. |
|
|
147
153
|
| `json` | Object to send as JSON, encoded with the session's `json_dumps`. Sets `Content-Type: application/json` unless you set it. |
|
|
148
154
|
| `files` | Dict (or list of pairs) of files to send as `multipart/form-data`, with any `data` dict as extra fields. A value is an open file, or `(filename, content)` or `(filename, content, content_type)`, where content is `bytes`, `str` or a file. Files are read into memory. |
|
|
149
155
|
| `cert` | `(certfile, keyfile)`, overriding the session's certificate. |
|
|
@@ -172,7 +178,7 @@ Failed transfers raise `httpperf.RequestError` with curl's detailed error messag
|
|
|
172
178
|
| `text` | Body decoded with `encoding`. |
|
|
173
179
|
| `encoding` | From the `Content-Type` charset, else latin-1 (`utf-8` for JSON). Can be set. |
|
|
174
180
|
| `json()` | Body parsed with the session's `json_loads`, once. By default the standard library, always as UTF-8, as RFC 8259 requires. |
|
|
175
|
-
| `cookies`, `cookielist` | The
|
|
181
|
+
| `cookies`, `cookielist` | The cookies this response set, from its `Set-Cookie` headers, as a dict or as `Cookie` objects. The session's whole jar is `session.cookies()`. |
|
|
176
182
|
| `primary_ip` | Address connected to. |
|
|
177
183
|
| `upload_size`, `download_size` | Bytes, as integers. |
|
|
178
184
|
| `request` | The `Request`: `method`, `url`, `headers`, `cookies`, `auth`, `data`. |
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
An asyncio HTTP client for load testing, built on libcurl.
|
|
4
4
|
|
|
5
|
-
httpperf was called acurl until version 1.0.
|
|
6
|
-
|
|
7
5
|
## Design
|
|
8
6
|
|
|
9
7
|
A load-testing client has three jobs: drive as much load as possible from each machine, report the server's response times rather than time spent waiting on the client, and read responses promptly so the server never sees a slow reader. httpperf is built around these.
|
|
@@ -26,15 +24,23 @@ Bytes are read off the wire as they arrive, whatever Python is doing. If Python
|
|
|
26
24
|
pip install httpperf
|
|
27
25
|
```
|
|
28
26
|
|
|
29
|
-
Wheels are published for Linux on x86_64 and aarch64, for Python 3.9 to 3.15, with glibc 2.34 or later (Ubuntu 22.04, Debian 12, RHEL 9 and later) or musl (Alpine). They include their own libcurl, with HTTP/2
|
|
27
|
+
Wheels are published for Linux on x86_64 and aarch64, for Python 3.9 to 3.15, with glibc 2.34 or later (Ubuntu 22.04, Debian 12, RHEL 9 and later) or musl (Alpine). They include their own libcurl, with HTTP/2 and HTTP/3.
|
|
30
28
|
|
|
31
|
-
Anywhere else, including Python 3.8, pip builds from source against the system's libcurl, which needs its development headers and a C compiler. That libcurl decides whether HTTP/3 is available.
|
|
29
|
+
Anywhere else, including Python 3.8, pip builds from source against the system's libcurl, which needs its development headers and a C compiler. That libcurl decides whether HTTP/3 is available: `curl -V` lists `HTTP3` under Features when it does.
|
|
32
30
|
|
|
33
31
|
```sh
|
|
34
32
|
sudo apt install libcurl4-openssl-dev # Debian/Ubuntu
|
|
35
33
|
pip install httpperf
|
|
36
34
|
```
|
|
37
35
|
|
|
36
|
+
To build against your own libcurl even where a wheel exists, skip the wheel, point the build at it and make sure it is found at run time:
|
|
37
|
+
|
|
38
|
+
```sh
|
|
39
|
+
CFLAGS=-I$PREFIX/include LDFLAGS="-L$PREFIX/lib -Wl,-rpath,$PREFIX/lib" pip install --no-binary httpperf httpperf
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
A session with `http_version="HTTP/3"` raises `ValueError` if the libcurl in use lacks HTTP/3.
|
|
43
|
+
|
|
38
44
|
## Quick start
|
|
39
45
|
|
|
40
46
|
```python
|
|
@@ -71,7 +77,7 @@ All arguments are keyword-only. A session can be created anywhere, even outside
|
|
|
71
77
|
| `max_host_connections` | `0` | Per-session cap on connections per host. Needs `connections="session"` or `"none"`. |
|
|
72
78
|
| `max_connections` | `0` | Per-session cap on connections in use. Needs `connections="session"` or `"none"`. |
|
|
73
79
|
| `cert` | `None` | `(certfile, keyfile)` paths for a client certificate, used by every request unless the request overrides it. |
|
|
74
|
-
| `timeout` | `None` | Seconds allowed for each request, from the start of the transfer to the last byte (each redirect hop separately). `None` or 0 means no limit. |
|
|
80
|
+
| `timeout` | `None` | Seconds allowed for each request, from the start of the transfer to the last byte (each redirect hop separately). `None` or 0 means no limit. Prefer this to `asyncio.wait_for` or cancelling the task: a cancelled request still runs to the end in curl and holds its connection until then, while a timeout stops it. |
|
|
75
81
|
| `connect_timeout` | `None` | Seconds allowed to connect, TLS included. `None` means curl's default of 300 s. |
|
|
76
82
|
| `verify` | `False` | Server certificate checking. `False`: none, as most load tests want. `True`: check against the system CA bundle: `SSL_CERT_FILE` if set, otherwise libcurl's own default, or the usual system locations if it has none. A path: check against that CA bundle. Requests can override it. |
|
|
77
83
|
| `json_dumps` | `None` | Function that turns a `json=` argument into the request body (`str` or `bytes`). `None` means the engine's. |
|
|
@@ -117,7 +123,7 @@ An engine binds to the asyncio loop running when it is first used, and so does a
|
|
|
117
123
|
| `cookies` | Dict of cookies to send with this request (added to the session jar). |
|
|
118
124
|
| `cookie_list` | List of `Cookie` objects. |
|
|
119
125
|
| `auth` | `(username, password)` for basic auth. |
|
|
120
|
-
| `data` | Request body: `str` or `bytes` as is, or a dict or list of pairs, form-encoded with `Content-Type: application/x-www-form-urlencoded` unless you set it. |
|
|
126
|
+
| `data` | Request body: `str` or `bytes` as is, with no `Content-Type` unless you set one, or a dict or list of pairs, form-encoded with `Content-Type: application/x-www-form-urlencoded` unless you set it. |
|
|
121
127
|
| `json` | Object to send as JSON, encoded with the session's `json_dumps`. Sets `Content-Type: application/json` unless you set it. |
|
|
122
128
|
| `files` | Dict (or list of pairs) of files to send as `multipart/form-data`, with any `data` dict as extra fields. A value is an open file, or `(filename, content)` or `(filename, content, content_type)`, where content is `bytes`, `str` or a file. Files are read into memory. |
|
|
123
129
|
| `cert` | `(certfile, keyfile)`, overriding the session's certificate. |
|
|
@@ -146,7 +152,7 @@ Failed transfers raise `httpperf.RequestError` with curl's detailed error messag
|
|
|
146
152
|
| `text` | Body decoded with `encoding`. |
|
|
147
153
|
| `encoding` | From the `Content-Type` charset, else latin-1 (`utf-8` for JSON). Can be set. |
|
|
148
154
|
| `json()` | Body parsed with the session's `json_loads`, once. By default the standard library, always as UTF-8, as RFC 8259 requires. |
|
|
149
|
-
| `cookies`, `cookielist` | The
|
|
155
|
+
| `cookies`, `cookielist` | The cookies this response set, from its `Set-Cookie` headers, as a dict or as `Cookie` objects. The session's whole jar is `session.cookies()`. |
|
|
150
156
|
| `primary_ip` | Address connected to. |
|
|
151
157
|
| `upload_size`, `download_size` | Bytes, as integers. |
|
|
152
158
|
| `request` | The `Request`: `method`, `url`, `headers`, `cookies`, `auth`, `data`. |
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import asyncio
|
|
2
2
|
import collections.abc
|
|
3
3
|
import datetime
|
|
4
|
+
import email.utils
|
|
4
5
|
import http
|
|
5
6
|
import json as _json
|
|
6
7
|
import os
|
|
@@ -12,6 +13,7 @@ import weakref
|
|
|
12
13
|
from urllib.parse import urlencode, urlparse
|
|
13
14
|
|
|
14
15
|
from httpperf import _httpperf
|
|
16
|
+
from httpperf.version import __version__ as __version__
|
|
15
17
|
|
|
16
18
|
_json_dumps = _json.JSONEncoder(separators=(",", ":"), check_circular=False).encode
|
|
17
19
|
|
|
@@ -242,6 +244,47 @@ def _encoding_from_content_type(content_type):
|
|
|
242
244
|
return "latin1"
|
|
243
245
|
|
|
244
246
|
|
|
247
|
+
def _cookie_expiration(attrs):
|
|
248
|
+
if "max-age" in attrs:
|
|
249
|
+
try:
|
|
250
|
+
max_age = int(attrs["max-age"])
|
|
251
|
+
except ValueError:
|
|
252
|
+
return 0
|
|
253
|
+
return int(time.time()) + max_age if max_age > 0 else 1
|
|
254
|
+
if "expires" in attrs:
|
|
255
|
+
try:
|
|
256
|
+
return max(int(email.utils.parsedate_to_datetime(attrs["expires"]).timestamp()), 1)
|
|
257
|
+
except (TypeError, ValueError, IndexError, OverflowError):
|
|
258
|
+
return 0
|
|
259
|
+
return 0
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
def _parse_set_cookie(value, url):
|
|
263
|
+
pair, *rest = value.split(";")
|
|
264
|
+
name, sep, cookie_value = pair.partition("=")
|
|
265
|
+
if not sep or not name.strip():
|
|
266
|
+
return None
|
|
267
|
+
attrs = {}
|
|
268
|
+
for attr in rest:
|
|
269
|
+
key, _, attr_value = attr.partition("=")
|
|
270
|
+
attrs[key.strip().lower()] = attr_value.strip()
|
|
271
|
+
parsed = urlparse(url)
|
|
272
|
+
domain = attrs.get("domain", "").lstrip(".")
|
|
273
|
+
path = attrs.get("path", "")
|
|
274
|
+
if not path.startswith("/"):
|
|
275
|
+
path = parsed.path.rpartition("/")[0] or "/"
|
|
276
|
+
return Cookie(
|
|
277
|
+
"httponly" in attrs,
|
|
278
|
+
"." + domain if domain else parsed.hostname,
|
|
279
|
+
bool(domain),
|
|
280
|
+
path,
|
|
281
|
+
"secure" in attrs,
|
|
282
|
+
_cookie_expiration(attrs),
|
|
283
|
+
name.strip(),
|
|
284
|
+
cookie_value.strip(),
|
|
285
|
+
)
|
|
286
|
+
|
|
287
|
+
|
|
245
288
|
def _cookie_list_to_cookie_dict(cookie_list):
|
|
246
289
|
return {cookie.name: cookie.value for cookie in cookie_list}
|
|
247
290
|
|
|
@@ -271,7 +314,10 @@ class Request:
|
|
|
271
314
|
|
|
272
315
|
@property
|
|
273
316
|
def headers(self):
|
|
274
|
-
return
|
|
317
|
+
return {
|
|
318
|
+
name.strip(): value.strip()
|
|
319
|
+
for name, _, value in (header.partition(":") for header in self.header_list or ())
|
|
320
|
+
}
|
|
275
321
|
|
|
276
322
|
@property
|
|
277
323
|
def cookie_list(self):
|
|
@@ -279,7 +325,7 @@ class Request:
|
|
|
279
325
|
|
|
280
326
|
@property
|
|
281
327
|
def cookies(self):
|
|
282
|
-
return _cookie_list_to_cookie_dict(self.cookie_list)
|
|
328
|
+
return _cookie_list_to_cookie_dict(self.cookie_list or ())
|
|
283
329
|
|
|
284
330
|
@property
|
|
285
331
|
def auth(self):
|
|
@@ -452,7 +498,9 @@ class Response:
|
|
|
452
498
|
|
|
453
499
|
@property
|
|
454
500
|
def cookielist(self):
|
|
455
|
-
|
|
501
|
+
url = self.url
|
|
502
|
+
cookies = (_parse_set_cookie(v, url) for name, v in self.headers_tuple if name.lower() == "set-cookie")
|
|
503
|
+
return [cookie for cookie in cookies if cookie is not None]
|
|
456
504
|
|
|
457
505
|
@property
|
|
458
506
|
def cookies(self):
|
|
@@ -655,15 +703,10 @@ class Session:
|
|
|
655
703
|
headers_list.append("Content-Type: " + content_type)
|
|
656
704
|
|
|
657
705
|
if headers:
|
|
658
|
-
|
|
659
|
-
headers_list = []
|
|
660
|
-
headers_list.extend("%s: %s" % i for i in headers.items())
|
|
706
|
+
headers_list = list(headers_list or ()) + ["%s: %s" % i for i in headers.items()]
|
|
661
707
|
|
|
662
708
|
if cookies:
|
|
663
|
-
|
|
664
|
-
cookie_list = []
|
|
665
|
-
for k, v in cookies.items():
|
|
666
|
-
cookie_list.append(session_cookie_for_url(url, k, v))
|
|
709
|
+
cookie_list = list(cookie_list or ()) + [session_cookie_for_url(url, k, v) for k, v in cookies.items()]
|
|
667
710
|
|
|
668
711
|
return await self._request(
|
|
669
712
|
method,
|
|
@@ -798,6 +841,8 @@ class Engine:
|
|
|
798
841
|
|
|
799
842
|
def _complete(self):
|
|
800
843
|
for error, response, future in self._ae_loop.get_completed():
|
|
844
|
+
if future.done():
|
|
845
|
+
continue
|
|
801
846
|
if response is not None:
|
|
802
847
|
future.set_result(response)
|
|
803
848
|
else:
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "1.0rc2"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: httpperf
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.0rc2
|
|
4
4
|
Summary: An asyncio HTTP client for load testing, built on libcurl.
|
|
5
5
|
Author-email: Tony Simpson <agjasimpson@gmail.com>
|
|
6
6
|
Project-URL: Source, https://github.com/tonysimpson/httpperf
|
|
@@ -28,8 +28,6 @@ Dynamic: license-file
|
|
|
28
28
|
|
|
29
29
|
An asyncio HTTP client for load testing, built on libcurl.
|
|
30
30
|
|
|
31
|
-
httpperf was called acurl until version 1.0.
|
|
32
|
-
|
|
33
31
|
## Design
|
|
34
32
|
|
|
35
33
|
A load-testing client has three jobs: drive as much load as possible from each machine, report the server's response times rather than time spent waiting on the client, and read responses promptly so the server never sees a slow reader. httpperf is built around these.
|
|
@@ -52,15 +50,23 @@ Bytes are read off the wire as they arrive, whatever Python is doing. If Python
|
|
|
52
50
|
pip install httpperf
|
|
53
51
|
```
|
|
54
52
|
|
|
55
|
-
Wheels are published for Linux on x86_64 and aarch64, for Python 3.9 to 3.15, with glibc 2.34 or later (Ubuntu 22.04, Debian 12, RHEL 9 and later) or musl (Alpine). They include their own libcurl, with HTTP/2
|
|
53
|
+
Wheels are published for Linux on x86_64 and aarch64, for Python 3.9 to 3.15, with glibc 2.34 or later (Ubuntu 22.04, Debian 12, RHEL 9 and later) or musl (Alpine). They include their own libcurl, with HTTP/2 and HTTP/3.
|
|
56
54
|
|
|
57
|
-
Anywhere else, including Python 3.8, pip builds from source against the system's libcurl, which needs its development headers and a C compiler. That libcurl decides whether HTTP/3 is available.
|
|
55
|
+
Anywhere else, including Python 3.8, pip builds from source against the system's libcurl, which needs its development headers and a C compiler. That libcurl decides whether HTTP/3 is available: `curl -V` lists `HTTP3` under Features when it does.
|
|
58
56
|
|
|
59
57
|
```sh
|
|
60
58
|
sudo apt install libcurl4-openssl-dev # Debian/Ubuntu
|
|
61
59
|
pip install httpperf
|
|
62
60
|
```
|
|
63
61
|
|
|
62
|
+
To build against your own libcurl even where a wheel exists, skip the wheel, point the build at it and make sure it is found at run time:
|
|
63
|
+
|
|
64
|
+
```sh
|
|
65
|
+
CFLAGS=-I$PREFIX/include LDFLAGS="-L$PREFIX/lib -Wl,-rpath,$PREFIX/lib" pip install --no-binary httpperf httpperf
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
A session with `http_version="HTTP/3"` raises `ValueError` if the libcurl in use lacks HTTP/3.
|
|
69
|
+
|
|
64
70
|
## Quick start
|
|
65
71
|
|
|
66
72
|
```python
|
|
@@ -97,7 +103,7 @@ All arguments are keyword-only. A session can be created anywhere, even outside
|
|
|
97
103
|
| `max_host_connections` | `0` | Per-session cap on connections per host. Needs `connections="session"` or `"none"`. |
|
|
98
104
|
| `max_connections` | `0` | Per-session cap on connections in use. Needs `connections="session"` or `"none"`. |
|
|
99
105
|
| `cert` | `None` | `(certfile, keyfile)` paths for a client certificate, used by every request unless the request overrides it. |
|
|
100
|
-
| `timeout` | `None` | Seconds allowed for each request, from the start of the transfer to the last byte (each redirect hop separately). `None` or 0 means no limit. |
|
|
106
|
+
| `timeout` | `None` | Seconds allowed for each request, from the start of the transfer to the last byte (each redirect hop separately). `None` or 0 means no limit. Prefer this to `asyncio.wait_for` or cancelling the task: a cancelled request still runs to the end in curl and holds its connection until then, while a timeout stops it. |
|
|
101
107
|
| `connect_timeout` | `None` | Seconds allowed to connect, TLS included. `None` means curl's default of 300 s. |
|
|
102
108
|
| `verify` | `False` | Server certificate checking. `False`: none, as most load tests want. `True`: check against the system CA bundle: `SSL_CERT_FILE` if set, otherwise libcurl's own default, or the usual system locations if it has none. A path: check against that CA bundle. Requests can override it. |
|
|
103
109
|
| `json_dumps` | `None` | Function that turns a `json=` argument into the request body (`str` or `bytes`). `None` means the engine's. |
|
|
@@ -143,7 +149,7 @@ An engine binds to the asyncio loop running when it is first used, and so does a
|
|
|
143
149
|
| `cookies` | Dict of cookies to send with this request (added to the session jar). |
|
|
144
150
|
| `cookie_list` | List of `Cookie` objects. |
|
|
145
151
|
| `auth` | `(username, password)` for basic auth. |
|
|
146
|
-
| `data` | Request body: `str` or `bytes` as is, or a dict or list of pairs, form-encoded with `Content-Type: application/x-www-form-urlencoded` unless you set it. |
|
|
152
|
+
| `data` | Request body: `str` or `bytes` as is, with no `Content-Type` unless you set one, or a dict or list of pairs, form-encoded with `Content-Type: application/x-www-form-urlencoded` unless you set it. |
|
|
147
153
|
| `json` | Object to send as JSON, encoded with the session's `json_dumps`. Sets `Content-Type: application/json` unless you set it. |
|
|
148
154
|
| `files` | Dict (or list of pairs) of files to send as `multipart/form-data`, with any `data` dict as extra fields. A value is an open file, or `(filename, content)` or `(filename, content, content_type)`, where content is `bytes`, `str` or a file. Files are read into memory. |
|
|
149
155
|
| `cert` | `(certfile, keyfile)`, overriding the session's certificate. |
|
|
@@ -172,7 +178,7 @@ Failed transfers raise `httpperf.RequestError` with curl's detailed error messag
|
|
|
172
178
|
| `text` | Body decoded with `encoding`. |
|
|
173
179
|
| `encoding` | From the `Content-Type` charset, else latin-1 (`utf-8` for JSON). Can be set. |
|
|
174
180
|
| `json()` | Body parsed with the session's `json_loads`, once. By default the standard library, always as UTF-8, as RFC 8259 requires. |
|
|
175
|
-
| `cookies`, `cookielist` | The
|
|
181
|
+
| `cookies`, `cookielist` | The cookies this response set, from its `Set-Cookie` headers, as a dict or as `Cookie` objects. The session's whole jar is `session.cookies()`. |
|
|
176
182
|
| `primary_ip` | Address connected to. |
|
|
177
183
|
| `upload_size`, `download_size` | Bytes, as integers. |
|
|
178
184
|
| `request` | The `Request`: `method`, `url`, `headers`, `cookies`, `auth`, `data`. |
|
|
@@ -424,8 +424,6 @@ static PyObject *session_cookielist(Session *session) {
|
|
|
424
424
|
return list;
|
|
425
425
|
}
|
|
426
426
|
|
|
427
|
-
static PyObject *Response_get_cookielist(Response *self, PyObject *args) { return session_cookielist(self->session); }
|
|
428
|
-
|
|
429
427
|
static PyMethodDef Response_methods[] = {
|
|
430
428
|
{"get_effective_url", (PyCFunction)Response_get_effective_url, METH_NOARGS, ""},
|
|
431
429
|
{"get_response_code", (PyCFunction)Response_get_response_code, METH_NOARGS, ""},
|
|
@@ -448,7 +446,6 @@ static PyMethodDef Response_methods[] = {
|
|
|
448
446
|
{"get_http_version", (PyCFunction)Response_get_http_version, METH_NOARGS, "Get the HTTP version used"},
|
|
449
447
|
{"get_queue_time", (PyCFunction)Response_get_queue_time, METH_NOARGS,
|
|
450
448
|
"Get the time spent waiting for a connection"},
|
|
451
|
-
{"get_cookielist", (PyCFunction)Response_get_cookielist, METH_NOARGS, ""},
|
|
452
449
|
{"get_redirect_url", (PyCFunction)Response_get_redirect_url, METH_NOARGS, "Get the redirect URL or None"},
|
|
453
450
|
{"get_header", (PyCFunction)Response_get_header, METH_NOARGS, "Get the header"},
|
|
454
451
|
{"get_body", (PyCFunction)Response_get_body, METH_NOARGS, "Get the body"},
|
|
@@ -1452,6 +1449,7 @@ static PyObject *Session_request(Session *self, PyObject *args, PyObject *kwds)
|
|
|
1452
1449
|
REQUEST_TRACE_PRINT("Session_request", rd);
|
|
1453
1450
|
rd->timeout_ms = timeout_ms;
|
|
1454
1451
|
rd->connect_timeout_ms = connect_timeout_ms;
|
|
1452
|
+
bool has_content_type = false;
|
|
1455
1453
|
if (headers != Py_None) {
|
|
1456
1454
|
if (!PyTuple_CheckExact(headers)) {
|
|
1457
1455
|
PyErr_SetString(PyExc_ValueError, "headers should be a tuple of strings or None");
|
|
@@ -1466,11 +1464,19 @@ static PyObject *Session_request(Session *self, PyObject *args, PyObject *kwds)
|
|
|
1466
1464
|
if (header == NULL) {
|
|
1467
1465
|
goto error_cleanup;
|
|
1468
1466
|
}
|
|
1467
|
+
if (strncasecmp(header, "content-type", 12) == 0 && strchr(":; \t", header[12]) != NULL) {
|
|
1468
|
+
has_content_type = true;
|
|
1469
|
+
}
|
|
1469
1470
|
struct curl_slist *appended = curl_slist_append(rd->headers, header);
|
|
1470
1471
|
CHECK_ALLOC(appended);
|
|
1471
1472
|
rd->headers = appended;
|
|
1472
1473
|
}
|
|
1473
1474
|
}
|
|
1475
|
+
if (req_data_buf != NULL && !has_content_type) {
|
|
1476
|
+
struct curl_slist *appended = curl_slist_append(rd->headers, "Content-Type:");
|
|
1477
|
+
CHECK_ALLOC(appended);
|
|
1478
|
+
rd->headers = appended;
|
|
1479
|
+
}
|
|
1474
1480
|
if (auth != Py_None) {
|
|
1475
1481
|
if (!PyTuple_CheckExact(auth) || PyTuple_GET_SIZE(auth) != 2 ||
|
|
1476
1482
|
!PyUnicode_CheckExact(PyTuple_GET_ITEM(auth, 0)) || !PyUnicode_CheckExact(PyTuple_GET_ITEM(auth, 1))) {
|
|
@@ -0,0 +1,542 @@
|
|
|
1
|
+
import asyncio
|
|
2
|
+
import datetime
|
|
3
|
+
import json
|
|
4
|
+
import time
|
|
5
|
+
|
|
6
|
+
import pytest
|
|
7
|
+
|
|
8
|
+
import httpperf
|
|
9
|
+
from httpperf import version
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def call(method, url, **kwargs):
|
|
13
|
+
async def main():
|
|
14
|
+
async with httpperf.Session() as session:
|
|
15
|
+
return await getattr(session, method)(url, **kwargs)
|
|
16
|
+
|
|
17
|
+
return asyncio.run(main())
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def with_session(fn):
|
|
21
|
+
async def main():
|
|
22
|
+
async with httpperf.Session() as session:
|
|
23
|
+
return await fn(session)
|
|
24
|
+
|
|
25
|
+
return asyncio.run(main())
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def test_version():
|
|
29
|
+
assert httpperf.__version__ == version.__version__
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
@pytest.mark.parametrize("method", ["get", "put", "patch", "post", "delete"])
|
|
33
|
+
def test_methods(httpbin, method):
|
|
34
|
+
r = call(method, httpbin.url + "/anything")
|
|
35
|
+
assert r.status_code == 200
|
|
36
|
+
assert r.json()["method"] == method.upper()
|
|
37
|
+
assert r.request.method == method.upper()
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def test_head(httpbin):
|
|
41
|
+
r = call("head", httpbin.url + "/get")
|
|
42
|
+
assert (r.status_code, r.body, r.request.method) == (200, b"", "HEAD")
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def test_options(httpbin):
|
|
46
|
+
r = call("options", httpbin.url + "/anything")
|
|
47
|
+
assert (r.status_code, r.request.method) == (200, "OPTIONS")
|
|
48
|
+
assert "OPTIONS" in r.headers["Allow"]
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def test_request_with_custom_method(httpbin):
|
|
52
|
+
r = with_session(lambda s: s.request("PROPFIND", httpbin.url + "/anything"))
|
|
53
|
+
assert (r.status_code, r.request.method) == (405, "PROPFIND")
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def test_request_without_options(httpbin):
|
|
57
|
+
r = call("get", httpbin.url + "/get")
|
|
58
|
+
req = r.request
|
|
59
|
+
assert req.method == "GET"
|
|
60
|
+
assert req.url == httpbin.url + "/get"
|
|
61
|
+
assert req.header_list is None
|
|
62
|
+
assert req.headers == {}
|
|
63
|
+
assert req.cookie_list is None
|
|
64
|
+
assert req.cookies == {}
|
|
65
|
+
assert req.auth is None
|
|
66
|
+
assert req.data is None
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
def test_request_with_options(httpbin):
|
|
70
|
+
r = call(
|
|
71
|
+
"post",
|
|
72
|
+
httpbin.url + "/post",
|
|
73
|
+
headers={"X-A": "1"},
|
|
74
|
+
cookies={"c": "v"},
|
|
75
|
+
auth=("user", "pass"),
|
|
76
|
+
data="body",
|
|
77
|
+
)
|
|
78
|
+
req = r.request
|
|
79
|
+
assert req.header_list == ("X-A: 1",)
|
|
80
|
+
assert req.headers == {"X-A": "1"}
|
|
81
|
+
assert [c.name for c in req.cookie_list] == ["c"]
|
|
82
|
+
assert req.cookies == {"c": "v"}
|
|
83
|
+
assert req.auth == ("user", "pass")
|
|
84
|
+
assert req.data == "body"
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
def test_request_headers_without_a_space(httpbin):
|
|
88
|
+
r = call("get", httpbin.url + "/headers", headers_list=["X-A:1", "X-B: 2"])
|
|
89
|
+
assert r.request.headers == {"X-A": "1", "X-B": "2"}
|
|
90
|
+
assert r.json()["headers"]["X-A"] == "1"
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
@pytest.mark.parametrize("headers", [None, {}])
|
|
94
|
+
@pytest.mark.parametrize("headers_list", [None, [], ()])
|
|
95
|
+
def test_empty_headers(httpbin, headers, headers_list):
|
|
96
|
+
r = call("get", httpbin.url + "/headers", headers=headers, headers_list=headers_list)
|
|
97
|
+
assert r.status_code == 200
|
|
98
|
+
assert r.request.headers == {}
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
@pytest.mark.parametrize("cookies", [None, {}])
|
|
102
|
+
@pytest.mark.parametrize("cookie_list", [None, [], ()])
|
|
103
|
+
def test_empty_cookies(httpbin, cookies, cookie_list):
|
|
104
|
+
r = call("get", httpbin.url + "/cookies", cookies=cookies, cookie_list=cookie_list)
|
|
105
|
+
assert r.json()["cookies"] == {}
|
|
106
|
+
assert r.request.cookies == {}
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
def test_empty_bodies(httpbin):
|
|
110
|
+
for data in [None, "", b""]:
|
|
111
|
+
r = call("post", httpbin.url + "/post", data=data)
|
|
112
|
+
assert r.json()["data"] == ""
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
def test_headers_and_headers_list(httpbin):
|
|
116
|
+
r = call("get", httpbin.url + "/headers", headers={"X-A": "1"}, headers_list=["X-B: 2"])
|
|
117
|
+
sent = r.json()["headers"]
|
|
118
|
+
assert (sent["X-A"], sent["X-B"]) == ("1", "2")
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
def test_header_tuples_are_accepted(httpbin):
|
|
122
|
+
r = call("get", httpbin.url + "/headers", headers_list=("X-B: 2",))
|
|
123
|
+
assert r.json()["headers"]["X-B"] == "2"
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
def test_arguments_are_not_modified(httpbin):
|
|
127
|
+
headers_list = ["X-B: 2"]
|
|
128
|
+
cookie_list = [httpperf.session_cookie_for_url(httpbin.url, "a", "1")]
|
|
129
|
+
headers = {"X-A": "1"}
|
|
130
|
+
cookies = {"b": "2"}
|
|
131
|
+
for _ in range(2):
|
|
132
|
+
r = call(
|
|
133
|
+
"post",
|
|
134
|
+
httpbin.url + "/anything",
|
|
135
|
+
headers=headers,
|
|
136
|
+
headers_list=headers_list,
|
|
137
|
+
cookies=cookies,
|
|
138
|
+
cookie_list=cookie_list,
|
|
139
|
+
json={},
|
|
140
|
+
)
|
|
141
|
+
assert r.json()["headers"]["X-A"] == "1"
|
|
142
|
+
assert headers_list == ["X-B: 2"]
|
|
143
|
+
assert len(cookie_list) == 1
|
|
144
|
+
assert headers == {"X-A": "1"} and cookies == {"b": "2"}
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
def test_cookie_list_kwarg(httpbin):
|
|
148
|
+
cookie = httpperf.session_cookie_for_url(httpbin.url, "a", "1")
|
|
149
|
+
r = call("get", httpbin.url + "/cookies", cookie_list=[cookie], cookies={"b": "2"})
|
|
150
|
+
assert r.json()["cookies"] == {"a": "1", "b": "2"}
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
@pytest.mark.parametrize(
|
|
154
|
+
"url, params, query",
|
|
155
|
+
[
|
|
156
|
+
("/get", {"a": "1"}, {"a": "1"}),
|
|
157
|
+
("/get", {"a": ["1", "2"]}, {"a": ["1", "2"]}),
|
|
158
|
+
("/get", [("a", "1"), ("b", "2")], {"a": "1", "b": "2"}),
|
|
159
|
+
("/get", "a=1", {"a": "1"}),
|
|
160
|
+
("/get?x=0", {"a": "1"}, {"x": "0", "a": "1"}),
|
|
161
|
+
("/get#frag", {"a": "1"}, {"a": "1"}),
|
|
162
|
+
("/get", {}, {}),
|
|
163
|
+
],
|
|
164
|
+
)
|
|
165
|
+
def test_params(httpbin, url, params, query):
|
|
166
|
+
r = call("get", httpbin.url + url, params=params)
|
|
167
|
+
assert r.json()["args"] == query
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
@pytest.mark.parametrize(
|
|
171
|
+
"data, form, raw",
|
|
172
|
+
[
|
|
173
|
+
({"a": "1"}, {"a": "1"}, ""),
|
|
174
|
+
([("a", "1"), ("a", "2")], {"a": ["1", "2"]}, ""),
|
|
175
|
+
("text", {}, "text"),
|
|
176
|
+
(b"\x00\xff", {}, "data:application/octet-stream;base64,AP8="),
|
|
177
|
+
],
|
|
178
|
+
)
|
|
179
|
+
def test_data(httpbin, data, form, raw):
|
|
180
|
+
headers = None if isinstance(data, (dict, list)) else {"Content-Type": "application/octet-stream"}
|
|
181
|
+
body = call("post", httpbin.url + "/post", data=data, headers=headers).json()
|
|
182
|
+
assert body["form"] == form
|
|
183
|
+
assert body["data"] == raw
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
@pytest.mark.parametrize("data", ["text", b"bytes", ""])
|
|
187
|
+
def test_raw_data_has_no_content_type(httpbin, data):
|
|
188
|
+
body = call("post", httpbin.url + "/anything", data=data).json()
|
|
189
|
+
assert "Content-Type" not in body["headers"]
|
|
190
|
+
assert body["data"] == (data.decode() if isinstance(data, bytes) else data)
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
@pytest.mark.parametrize("header", ["content-type: text/plain", "Content-Type:text/plain", "CONTENT-TYPE: text/plain"])
|
|
194
|
+
def test_raw_data_keeps_a_set_content_type(httpbin, header):
|
|
195
|
+
body = call("post", httpbin.url + "/anything", data="x", headers_list=[header]).json()
|
|
196
|
+
assert body["headers"]["Content-Type"] == "text/plain"
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
def test_json_kwarg(httpbin):
|
|
200
|
+
body = call("post", httpbin.url + "/post", json={"a": [1, None]}).json()
|
|
201
|
+
assert body["json"] == {"a": [1, None]}
|
|
202
|
+
assert body["headers"]["Content-Type"] == "application/json"
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
def test_json_kwarg_falsy_values(httpbin):
|
|
206
|
+
for value in [{}, [], 0, False, ""]:
|
|
207
|
+
assert call("post", httpbin.url + "/post", json=value).json()["json"] == value
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
def test_explicit_content_type_wins(httpbin):
|
|
211
|
+
body = call("post", httpbin.url + "/post", json={"a": 1}, headers={"content-type": "application/vnd+json"}).json()
|
|
212
|
+
assert body["headers"]["Content-Type"] == "application/vnd+json"
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
def test_json_with_data_raises(httpbin):
|
|
216
|
+
with pytest.raises(ValueError):
|
|
217
|
+
call("post", httpbin.url + "/post", json={}, data="x")
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
def test_files_without_data(httpbin):
|
|
221
|
+
body = call("post", httpbin.url + "/post", files={"f": ("name.txt", b"abc", "text/plain")}).json()
|
|
222
|
+
assert body["files"] == {"f": "abc"}
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
def test_auth(httpbin):
|
|
226
|
+
r = call("get", httpbin.url + "/basic-auth/user/pass", auth=("user", "pass"))
|
|
227
|
+
assert r.json() == {"authenticated": True, "user": "user"}
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
def test_allow_redirects(httpbin):
|
|
231
|
+
r = call("get", httpbin.url + "/redirect/1", allow_redirects=False)
|
|
232
|
+
assert r.status_code == 302
|
|
233
|
+
assert r.redirect_url == httpbin.url + "/get"
|
|
234
|
+
assert r.history == []
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
def test_no_redirect_url(httpbin):
|
|
238
|
+
assert call("get", httpbin.url + "/get").redirect_url is None
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
def test_max_redirects(httpbin):
|
|
242
|
+
with pytest.raises(httpperf.RequestError, match="Max Redirects"):
|
|
243
|
+
call("get", httpbin.url + "/redirect/3", max_redirects=2)
|
|
244
|
+
assert call("get", httpbin.url + "/redirect/2", max_redirects=2).status_code == 200
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
@pytest.mark.parametrize("status, method", [(301, "GET"), (302, "GET"), (303, "GET"), (307, "POST"), (308, "POST")])
|
|
248
|
+
def test_redirect_method(httpbin, status, method):
|
|
249
|
+
r = call(
|
|
250
|
+
"post",
|
|
251
|
+
httpbin.url + "/redirect-to",
|
|
252
|
+
params={"url": "/anything", "status_code": status},
|
|
253
|
+
data="x",
|
|
254
|
+
headers={"Content-Type": "text/plain"},
|
|
255
|
+
)
|
|
256
|
+
assert r.json()["method"] == method
|
|
257
|
+
assert r.json()["data"] == ("x" if method == "POST" else "")
|
|
258
|
+
assert [h.status_code for h in r.history] == [status]
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
def test_redirects_keep_headers(httpbin):
|
|
262
|
+
r = call("get", httpbin.url + "/redirect/1", headers={"X-A": "1"})
|
|
263
|
+
assert r.json()["headers"]["X-A"] == "1"
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
def test_request_timeout(httpbin):
|
|
267
|
+
with pytest.raises(httpperf.Timeout) as e:
|
|
268
|
+
call("get", httpbin.url + "/delay/2", timeout=0.2)
|
|
269
|
+
assert e.value.code == httpperf.CURLE_OPERATION_TIMEDOUT
|
|
270
|
+
assert isinstance(e.value, httpperf.RequestError)
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
def test_session_timeout(httpbin):
|
|
274
|
+
async def main():
|
|
275
|
+
async with httpperf.Session(timeout=0.2) as s:
|
|
276
|
+
with pytest.raises(httpperf.Timeout):
|
|
277
|
+
await s.get(httpbin.url + "/delay/2")
|
|
278
|
+
r = await s.get(httpbin.url + "/delay/1", timeout=5)
|
|
279
|
+
return r.status_code
|
|
280
|
+
|
|
281
|
+
assert asyncio.run(main()) == 200
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
def test_connection_refused():
|
|
285
|
+
with pytest.raises(httpperf.RequestError) as e:
|
|
286
|
+
call("get", "http://127.0.0.1:9/")
|
|
287
|
+
assert e.value.code == 7
|
|
288
|
+
assert not isinstance(e.value, httpperf.Timeout)
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
def test_response_properties(httpbin):
|
|
292
|
+
r = call("get", httpbin.url + "/response-headers", params={"X-Test": "a"})
|
|
293
|
+
assert r.status_code == r.response_code == 200
|
|
294
|
+
assert r.ok and r.reason == "OK"
|
|
295
|
+
assert isinstance(r.elapsed, datetime.timedelta)
|
|
296
|
+
assert r.url.startswith(httpbin.url + "/response-headers")
|
|
297
|
+
assert r.start_time <= r.end_time
|
|
298
|
+
assert r.queue_time >= 0
|
|
299
|
+
assert isinstance(r.client_lag, float)
|
|
300
|
+
times = [
|
|
301
|
+
r.namelookup_time,
|
|
302
|
+
r.connect_time,
|
|
303
|
+
r.pretransfer_time,
|
|
304
|
+
r.starttransfer_time,
|
|
305
|
+
r.total_time,
|
|
306
|
+
]
|
|
307
|
+
assert times == sorted(times)
|
|
308
|
+
assert r.appconnect_time == 0
|
|
309
|
+
assert r.posttransfer_time >= 0
|
|
310
|
+
assert r.upload_size == 0
|
|
311
|
+
assert r.download_size == len(r.body)
|
|
312
|
+
assert r.primary_ip == "127.0.0.1"
|
|
313
|
+
assert r.http_version == "HTTP/1.1"
|
|
314
|
+
assert r.encoding == "utf-8"
|
|
315
|
+
assert r.text == r.body.decode()
|
|
316
|
+
assert r.json() is r.json()
|
|
317
|
+
assert r.headers["x-test"] == "a"
|
|
318
|
+
assert ("X-Test", "a") in r.headers_tuple
|
|
319
|
+
assert r.header.startswith("HTTP/1.")
|
|
320
|
+
assert r.cookielist == [] and r.cookies == {}
|
|
321
|
+
assert r.history == []
|
|
322
|
+
|
|
323
|
+
|
|
324
|
+
def test_empty_response(httpbin):
|
|
325
|
+
r = call("get", httpbin.url + "/status/204")
|
|
326
|
+
assert (r.status_code, r.body, r.text, r.download_size) == (204, b"", "", 0)
|
|
327
|
+
assert r.reason == "NO CONTENT"
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
def test_upload_size(httpbin):
|
|
331
|
+
assert call("post", httpbin.url + "/post", data=b"x" * 100).upload_size == 100
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
def test_response_cookies(httpbin):
|
|
335
|
+
r = call("get", httpbin.url + "/cookies/set", params={"a": "1"})
|
|
336
|
+
assert r.history[0].cookies == {"a": "1"}
|
|
337
|
+
assert r.cookies == {}
|
|
338
|
+
assert r.history[0].cookielist[0].format() == "127.0.0.1\tFALSE\t/\tFALSE\t0\ta\t1"
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
def test_response_cookies_are_only_this_responses(httpbin):
|
|
342
|
+
async def main(s):
|
|
343
|
+
await s.get(httpbin.url + "/cookies/set", params={"a": "1"})
|
|
344
|
+
r = await s.get(httpbin.url + "/response-headers", params={"Set-Cookie": "b=2"})
|
|
345
|
+
return r.cookies, s.cookies()
|
|
346
|
+
|
|
347
|
+
assert with_session(main) == ({"b": "2"}, {"a": "1", "b": "2"})
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
def test_response_cookie_attributes(httpbin):
|
|
351
|
+
now = time.time()
|
|
352
|
+
r = call(
|
|
353
|
+
"get",
|
|
354
|
+
httpbin.url + "/response-headers",
|
|
355
|
+
params=[
|
|
356
|
+
("Set-Cookie", "plain=1"),
|
|
357
|
+
("Set-Cookie", "full=2; Domain=.example.com; Path=/p; Secure; HttpOnly; Max-Age=60"),
|
|
358
|
+
("Set-Cookie", "dated=3; Expires=Wed, 21 Oct 2037 07:28:00 GMT"),
|
|
359
|
+
("Set-Cookie", "gone=4; Max-Age=0"),
|
|
360
|
+
("Set-Cookie", "empty="),
|
|
361
|
+
("Set-Cookie", "invalid"),
|
|
362
|
+
],
|
|
363
|
+
)
|
|
364
|
+
cookies = {c.name: c for c in r.cookielist}
|
|
365
|
+
assert list(cookies) == ["plain", "full", "dated", "gone", "empty"]
|
|
366
|
+
plain = cookies["plain"]
|
|
367
|
+
assert (plain.domain, plain.include_subdomains, plain.path, plain.is_secure, plain.http_only) == (
|
|
368
|
+
"127.0.0.1",
|
|
369
|
+
False,
|
|
370
|
+
"/",
|
|
371
|
+
False,
|
|
372
|
+
False,
|
|
373
|
+
)
|
|
374
|
+
assert plain.expiration == 0 and not plain.has_expired
|
|
375
|
+
full = cookies["full"]
|
|
376
|
+
assert (full.domain, full.include_subdomains, full.path, full.is_secure, full.http_only) == (
|
|
377
|
+
".example.com",
|
|
378
|
+
True,
|
|
379
|
+
"/p",
|
|
380
|
+
True,
|
|
381
|
+
True,
|
|
382
|
+
)
|
|
383
|
+
assert now + 59 <= full.expiration <= now + 62
|
|
384
|
+
assert cookies["dated"].expiration == 2139722880
|
|
385
|
+
assert cookies["gone"].has_expired
|
|
386
|
+
assert cookies["empty"].value == ""
|
|
387
|
+
assert r.cookies == {"plain": "1", "full": "2", "dated": "3", "gone": "4", "empty": ""}
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
def test_response_callback(httpbin):
|
|
391
|
+
seen = []
|
|
392
|
+
|
|
393
|
+
async def main(s):
|
|
394
|
+
s.set_response_callback(seen.append)
|
|
395
|
+
return await s.get(httpbin.url + "/redirect/2")
|
|
396
|
+
|
|
397
|
+
r = with_session(main)
|
|
398
|
+
assert seen == r.history + [r]
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
def test_session_cookie_methods(httpbin):
|
|
402
|
+
async def main(s):
|
|
403
|
+
assert s.cookies() == {} and s.get_cookie_list() == []
|
|
404
|
+
await s.get(httpbin.url + "/cookies/set", params={"a": "1"})
|
|
405
|
+
assert s.cookies() == {"a": "1"}
|
|
406
|
+
s.add_cookie_list([httpperf.session_cookie_for_url(httpbin.url, "b", "2")])
|
|
407
|
+
assert sorted(c.name for c in s.get_cookie_list()) == ["a", "b"]
|
|
408
|
+
sent = (await s.get(httpbin.url + "/cookies")).json()["cookies"]
|
|
409
|
+
s.erase_session_cookies()
|
|
410
|
+
assert s.cookies() == {}
|
|
411
|
+
s.add_cookie_list([httpperf.session_cookie_for_url(httpbin.url, "c", "3")])
|
|
412
|
+
s.erase_all_cookies()
|
|
413
|
+
return sent, s.cookies()
|
|
414
|
+
|
|
415
|
+
assert with_session(main) == ({"a": "1", "b": "2"}, {})
|
|
416
|
+
|
|
417
|
+
|
|
418
|
+
def test_session_close_twice():
|
|
419
|
+
s = httpperf.Session()
|
|
420
|
+
s.close()
|
|
421
|
+
s.close()
|
|
422
|
+
|
|
423
|
+
|
|
424
|
+
def test_session_sync_context_manager():
|
|
425
|
+
with httpperf.Session() as s:
|
|
426
|
+
assert isinstance(s, httpperf.Session)
|
|
427
|
+
|
|
428
|
+
|
|
429
|
+
def test_session_with_engine(httpbin):
|
|
430
|
+
async def main():
|
|
431
|
+
async with httpperf.Engine() as engine:
|
|
432
|
+
async with httpperf.Session(engine=engine) as s:
|
|
433
|
+
return await s.get(httpbin.url + "/get")
|
|
434
|
+
|
|
435
|
+
assert asyncio.run(main()).status_code == 200
|
|
436
|
+
|
|
437
|
+
|
|
438
|
+
def test_engine_json_functions_reach_sessions(httpbin):
|
|
439
|
+
async def main():
|
|
440
|
+
with httpperf.Engine(json_dumps=lambda o: '{"x":1}', json_loads=lambda b: "loaded") as engine:
|
|
441
|
+
async with httpperf.Session(engine=engine) as s:
|
|
442
|
+
r = await s.post(httpbin.url + "/post", json={})
|
|
443
|
+
return r.json(), json.loads(r.body)["json"]
|
|
444
|
+
|
|
445
|
+
assert asyncio.run(main()) == ("loaded", {"x": 1})
|
|
446
|
+
|
|
447
|
+
|
|
448
|
+
def test_session_keyword_only():
|
|
449
|
+
with pytest.raises(TypeError):
|
|
450
|
+
httpperf.Session(None)
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
def test_cookie():
|
|
454
|
+
c = httpperf.Cookie(True, ".example.com", True, "/p", True, 5, "n", "v")
|
|
455
|
+
assert (c.http_only, c.domain, c.include_subdomains, c.path, c.is_secure, c.expiration, c.name, c.value) == (
|
|
456
|
+
True,
|
|
457
|
+
".example.com",
|
|
458
|
+
True,
|
|
459
|
+
"/p",
|
|
460
|
+
True,
|
|
461
|
+
5,
|
|
462
|
+
"n",
|
|
463
|
+
"v",
|
|
464
|
+
)
|
|
465
|
+
assert c.format() == "#HttpOnly_.example.com\tTRUE\t/p\tTRUE\t5\tn\tv"
|
|
466
|
+
assert str(c) == repr(c)
|
|
467
|
+
assert "name=n" in repr(c)
|
|
468
|
+
assert c.has_expired
|
|
469
|
+
|
|
470
|
+
|
|
471
|
+
def test_parse_cookie_string():
|
|
472
|
+
c = httpperf.parse_cookie_string("example.com\tFALSE\t/\tFALSE\t0\tn\tv\n")
|
|
473
|
+
assert (c.http_only, c.domain, c.include_subdomains, c.is_secure, c.expiration, c.name, c.value) == (
|
|
474
|
+
False,
|
|
475
|
+
"example.com",
|
|
476
|
+
False,
|
|
477
|
+
False,
|
|
478
|
+
0,
|
|
479
|
+
"n",
|
|
480
|
+
"v",
|
|
481
|
+
)
|
|
482
|
+
assert httpperf.parse_cookie_string(c.format()).format() == c.format()
|
|
483
|
+
assert httpperf.parse_cookie_string("example.com\tFALSE\t/\tFALSE\t0\tn").value == ""
|
|
484
|
+
|
|
485
|
+
|
|
486
|
+
def test_parse_cookie_list_string():
|
|
487
|
+
cookies = httpperf.parse_cookie_list_string("a.com\tFALSE\t/\tFALSE\t0\ta\t1\n\nb.com\tFALSE\t/\tFALSE\t0\tb\t2\n")
|
|
488
|
+
assert [(c.domain, c.name) for c in cookies] == [("a.com", "a"), ("b.com", "b")]
|
|
489
|
+
assert httpperf.parse_cookie_list_string("") == []
|
|
490
|
+
|
|
491
|
+
|
|
492
|
+
def test_session_cookie_for_url():
|
|
493
|
+
c = httpperf.session_cookie_for_url("https://example.com/a/b?q", "n", "v")
|
|
494
|
+
assert (c.domain, c.path, c.include_subdomains, c.is_secure, c.http_only, c.expiration) == (
|
|
495
|
+
".example.com",
|
|
496
|
+
"/",
|
|
497
|
+
True,
|
|
498
|
+
False,
|
|
499
|
+
False,
|
|
500
|
+
0,
|
|
501
|
+
)
|
|
502
|
+
c = httpperf.session_cookie_for_url(
|
|
503
|
+
"https://example.com/a/b",
|
|
504
|
+
"n",
|
|
505
|
+
"v",
|
|
506
|
+
http_only=True,
|
|
507
|
+
include_subdomains=False,
|
|
508
|
+
is_secure=True,
|
|
509
|
+
include_url_path=True,
|
|
510
|
+
)
|
|
511
|
+
assert (c.path, c.include_subdomains, c.is_secure, c.http_only) == ("/a/b", False, True, True)
|
|
512
|
+
|
|
513
|
+
|
|
514
|
+
def test_headers_mapping():
|
|
515
|
+
h = httpperf.Headers([("Content-Type", "text/plain"), ("Set-Cookie", "a"), ("set-cookie", "b")])
|
|
516
|
+
assert h["content-type"] == "text/plain"
|
|
517
|
+
assert h["SET-COOKIE"] == "a, b"
|
|
518
|
+
assert "Content-Type" in h and "missing" not in h and 1 not in h
|
|
519
|
+
assert list(h) == ["Content-Type", "Set-Cookie"]
|
|
520
|
+
assert len(h) == 2
|
|
521
|
+
assert h.get("missing") is None
|
|
522
|
+
assert dict(h) == {"Content-Type": "text/plain", "Set-Cookie": "a, b"}
|
|
523
|
+
assert repr(h) == repr(dict(h))
|
|
524
|
+
assert len(httpperf.Headers([])) == 0
|
|
525
|
+
|
|
526
|
+
|
|
527
|
+
def test_exceptions():
|
|
528
|
+
assert issubclass(httpperf.Timeout, httpperf.RequestError)
|
|
529
|
+
assert issubclass(httpperf.HTTPError, httpperf.RequestError)
|
|
530
|
+
assert issubclass(httpperf.RequestError, Exception)
|
|
531
|
+
assert httpperf.RequestError("m").code is None
|
|
532
|
+
assert httpperf.RequestError("m", 7).code == 7
|
|
533
|
+
assert httpperf.HTTPError("m", "resp").response == "resp"
|
|
534
|
+
|
|
535
|
+
|
|
536
|
+
@pytest.mark.parametrize(
|
|
537
|
+
"url, path",
|
|
538
|
+
[("http://h/a/b/c", "/a/b"), ("http://h/a", "/"), ("http://h", "/"), ("http://h/a/", "/a")],
|
|
539
|
+
)
|
|
540
|
+
def test_response_cookie_default_path(url, path):
|
|
541
|
+
assert httpperf._parse_set_cookie("n=v", url).path == path
|
|
542
|
+
assert httpperf._parse_set_cookie("n=v; Path=relative", url).path == path
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import asyncio
|
|
2
2
|
import errno
|
|
3
3
|
import gc
|
|
4
|
+
import http.server
|
|
4
5
|
import os
|
|
5
6
|
import socket
|
|
6
7
|
import subprocess
|
|
@@ -284,3 +285,42 @@ def test_default_engine_lasts_as_long_as_its_loop():
|
|
|
284
285
|
finally:
|
|
285
286
|
server.shutdown()
|
|
286
287
|
server.server_close()
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
def test_cancelled_requests_do_not_strand_others():
|
|
291
|
+
release = threading.Event()
|
|
292
|
+
|
|
293
|
+
class Handler(http.server.BaseHTTPRequestHandler):
|
|
294
|
+
protocol_version = "HTTP/1.1"
|
|
295
|
+
|
|
296
|
+
def do_GET(self):
|
|
297
|
+
release.wait(10)
|
|
298
|
+
self.send_response(200)
|
|
299
|
+
self.send_header("Content-Length", "0")
|
|
300
|
+
self.end_headers()
|
|
301
|
+
|
|
302
|
+
def log_message(self, *args):
|
|
303
|
+
pass
|
|
304
|
+
|
|
305
|
+
server = http.server.ThreadingHTTPServer(("127.0.0.1", 0), Handler)
|
|
306
|
+
threading.Thread(target=server.serve_forever, daemon=True).start()
|
|
307
|
+
url = "http://127.0.0.1:%d/" % server.server_address[1]
|
|
308
|
+
errors = []
|
|
309
|
+
|
|
310
|
+
async def main():
|
|
311
|
+
asyncio.get_running_loop().set_exception_handler(lambda loop, context: errors.append(context))
|
|
312
|
+
async with httpperf.Session(http_version="HTTP/1.1") as session:
|
|
313
|
+
tasks = [asyncio.create_task(session.get(url)) for _ in range(10)]
|
|
314
|
+
await asyncio.sleep(0.2)
|
|
315
|
+
for task in tasks[::2]:
|
|
316
|
+
task.cancel()
|
|
317
|
+
release.set()
|
|
318
|
+
done, pending = await asyncio.wait(tasks[1::2], timeout=5)
|
|
319
|
+
await asyncio.sleep(0.1)
|
|
320
|
+
return [t.result().status_code for t in done], len(pending)
|
|
321
|
+
|
|
322
|
+
try:
|
|
323
|
+
assert asyncio.run(main()) == ([200] * 5, 0)
|
|
324
|
+
assert errors == []
|
|
325
|
+
finally:
|
|
326
|
+
server.shutdown()
|
|
@@ -39,7 +39,8 @@ def test_get(httpbin):
|
|
|
39
39
|
def test_cookies(httpbin):
|
|
40
40
|
s = session()
|
|
41
41
|
r = _await(s.get(httpbin.url + "/cookies/set?name=value"))
|
|
42
|
-
assert r.cookies == {"name": "value"}
|
|
42
|
+
assert r.history[0].cookies == {"name": "value"}
|
|
43
|
+
assert r.cookies == {}
|
|
43
44
|
|
|
44
45
|
|
|
45
46
|
def test_session_cookies(httpbin):
|
|
@@ -57,9 +58,9 @@ def test_session_cookies(httpbin):
|
|
|
57
58
|
|
|
58
59
|
def test_set_cookies(httpbin):
|
|
59
60
|
s = session()
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
assert
|
|
61
|
+
_await(s.get(httpbin.url + "/cookies/set?name=value"))
|
|
62
|
+
_await(s.get(httpbin.url + "/cookies/set?name2=value", cookies={"name3": "value"}))
|
|
63
|
+
assert s.cookies() == {"name": "value", "name2": "value", "name3": "value"}
|
|
63
64
|
|
|
64
65
|
|
|
65
66
|
def test_add_and_erase_session_cookies(httpbin):
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "1.0rc1"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|