locust 2.29.2.dev6__py3-none-any.whl → 2.29.2.dev10__py3-none-any.whl
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.
- locust/_version.py +2 -2
- locust/contrib/fasthttp.py +48 -13
- locust/webui/dist/auth.html +1 -1
- locust/webui/dist/index.html +1 -1
- {locust-2.29.2.dev6.dist-info → locust-2.29.2.dev10.dist-info}/METADATA +1 -1
- {locust-2.29.2.dev6.dist-info → locust-2.29.2.dev10.dist-info}/RECORD +10 -11
- locust/webui/dist/assets/index-84c63e70.js +0 -250
- {locust-2.29.2.dev6.dist-info → locust-2.29.2.dev10.dist-info}/LICENSE +0 -0
- {locust-2.29.2.dev6.dist-info → locust-2.29.2.dev10.dist-info}/WHEEL +0 -0
- {locust-2.29.2.dev6.dist-info → locust-2.29.2.dev10.dist-info}/entry_points.txt +0 -0
- {locust-2.29.2.dev6.dist-info → locust-2.29.2.dev10.dist-info}/top_level.txt +0 -0
locust/_version.py
CHANGED
@@ -12,5 +12,5 @@ __version__: str
|
|
12
12
|
__version_tuple__: VERSION_TUPLE
|
13
13
|
version_tuple: VERSION_TUPLE
|
14
14
|
|
15
|
-
__version__ = version = '2.29.2.
|
16
|
-
__version_tuple__ = version_tuple = (2, 29, 2, '
|
15
|
+
__version__ = version = '2.29.2.dev10'
|
16
|
+
__version_tuple__ = version_tuple = (2, 29, 2, 'dev10')
|
locust/contrib/fasthttp.py
CHANGED
@@ -12,12 +12,11 @@ import socket
|
|
12
12
|
import time
|
13
13
|
import traceback
|
14
14
|
from base64 import b64encode
|
15
|
-
from collections.abc import Generator
|
16
15
|
from contextlib import contextmanager
|
17
16
|
from http.cookiejar import CookieJar
|
18
17
|
from json.decoder import JSONDecodeError
|
19
18
|
from ssl import SSLError
|
20
|
-
from typing import
|
19
|
+
from typing import TYPE_CHECKING, cast
|
21
20
|
from urllib.parse import urlparse, urlunparse
|
22
21
|
|
23
22
|
import gevent
|
@@ -32,6 +31,36 @@ from geventhttpclient.useragent import CompatRequest, CompatResponse, Connection
|
|
32
31
|
# borrow requests's content-type header parsing
|
33
32
|
from requests.utils import get_encoding_from_headers
|
34
33
|
|
34
|
+
if TYPE_CHECKING:
|
35
|
+
import sys
|
36
|
+
from collections.abc import Callable, Generator
|
37
|
+
from typing import TypedDict
|
38
|
+
|
39
|
+
if sys.version_info >= (3, 11):
|
40
|
+
from typing import Unpack
|
41
|
+
else:
|
42
|
+
from typing_extensions import Unpack
|
43
|
+
|
44
|
+
class PostKwargs(TypedDict, total=False):
|
45
|
+
name: str | None
|
46
|
+
catch_response: bool
|
47
|
+
stream: bool
|
48
|
+
headers: dict | None
|
49
|
+
auth: tuple[str | bytes, str | bytes] | None
|
50
|
+
allow_redirects: bool
|
51
|
+
context: dict
|
52
|
+
|
53
|
+
class PutKwargs(PostKwargs, total=False):
|
54
|
+
json: dict | None
|
55
|
+
|
56
|
+
class PatchKwargs(PostKwargs, total=False):
|
57
|
+
json: dict | None
|
58
|
+
|
59
|
+
class RESTKwargs(PostKwargs, total=False):
|
60
|
+
data: str | dict | None
|
61
|
+
json: dict | None
|
62
|
+
|
63
|
+
|
35
64
|
# Monkey patch geventhttpclient.useragent.CompatRequest so that Cookiejar works with Python >= 3.3
|
36
65
|
# More info: https://github.com/requests/requests/pull/871
|
37
66
|
CompatRequest.unverifiable = False
|
@@ -85,7 +114,7 @@ class FastHttpSession:
|
|
85
114
|
client_pool: HTTPClientPool | None = None,
|
86
115
|
ssl_context_factory: Callable | None = None,
|
87
116
|
**kwargs,
|
88
|
-
):
|
117
|
+
) -> None:
|
89
118
|
self.environment = environment
|
90
119
|
self.base_url = base_url
|
91
120
|
self.cookiejar = CookieJar()
|
@@ -117,14 +146,14 @@ class FastHttpSession:
|
|
117
146
|
# store authentication header (we construct this by using _basic_auth_str() function from requests.auth)
|
118
147
|
self.auth_header = _construct_basic_auth_str(parsed_url.username, parsed_url.password)
|
119
148
|
|
120
|
-
def _build_url(self, path):
|
149
|
+
def _build_url(self, path: str) -> str:
|
121
150
|
"""prepend url with hostname unless it's already an absolute URL"""
|
122
151
|
if absolute_http_url_regexp.match(path):
|
123
152
|
return path
|
124
153
|
else:
|
125
154
|
return f"{self.base_url}{path}"
|
126
155
|
|
127
|
-
def _send_request_safe_mode(self, method, url, **kwargs):
|
156
|
+
def _send_request_safe_mode(self, method: str, url: str, **kwargs):
|
128
157
|
"""
|
129
158
|
Send an HTTP request, and catch any exception that might occur due to either
|
130
159
|
connection problems, or invalid HTTP status codes
|
@@ -155,7 +184,7 @@ class FastHttpSession:
|
|
155
184
|
catch_response: bool = False,
|
156
185
|
stream: bool = False,
|
157
186
|
headers: dict | None = None,
|
158
|
-
auth=None,
|
187
|
+
auth: tuple[str | bytes, str | bytes] | None = None,
|
159
188
|
json: dict | None = None,
|
160
189
|
allow_redirects: bool = True,
|
161
190
|
context: dict = {},
|
@@ -264,31 +293,37 @@ class FastHttpSession:
|
|
264
293
|
self.environment.events.request.fire(**request_meta)
|
265
294
|
return response
|
266
295
|
|
267
|
-
def delete(self, url, **kwargs):
|
296
|
+
def delete(self, url: str, **kwargs: Unpack[RESTKwargs]) -> ResponseContextManager | FastResponse:
|
268
297
|
"""Sends a DELETE request"""
|
269
298
|
return self.request("DELETE", url, **kwargs)
|
270
299
|
|
271
|
-
def get(self, url, **kwargs):
|
300
|
+
def get(self, url: str, **kwargs: Unpack[RESTKwargs]) -> ResponseContextManager | FastResponse:
|
272
301
|
"""Sends a GET request"""
|
273
302
|
return self.request("GET", url, **kwargs)
|
274
303
|
|
275
|
-
def head(self, url, **kwargs):
|
304
|
+
def head(self, url: str, **kwargs: Unpack[RESTKwargs]) -> ResponseContextManager | FastResponse:
|
276
305
|
"""Sends a HEAD request"""
|
277
306
|
return self.request("HEAD", url, **kwargs)
|
278
307
|
|
279
|
-
def options(self, url, **kwargs):
|
308
|
+
def options(self, url: str, **kwargs: Unpack[RESTKwargs]) -> ResponseContextManager | FastResponse:
|
280
309
|
"""Sends a OPTIONS request"""
|
281
310
|
return self.request("OPTIONS", url, **kwargs)
|
282
311
|
|
283
|
-
def patch(
|
312
|
+
def patch(
|
313
|
+
self, url: str, data: str | dict | None = None, **kwargs: Unpack[PatchKwargs]
|
314
|
+
) -> ResponseContextManager | FastResponse:
|
284
315
|
"""Sends a PATCH request"""
|
285
316
|
return self.request("PATCH", url, data=data, **kwargs)
|
286
317
|
|
287
|
-
def post(
|
318
|
+
def post(
|
319
|
+
self, url: str, data: str | dict | None = None, json: dict | None = None, **kwargs: Unpack[PostKwargs]
|
320
|
+
) -> ResponseContextManager | FastResponse:
|
288
321
|
"""Sends a POST request"""
|
289
322
|
return self.request("POST", url, data=data, json=json, **kwargs)
|
290
323
|
|
291
|
-
def put(
|
324
|
+
def put(
|
325
|
+
self, url: str, data: str | dict | None = None, **kwargs: Unpack[PutKwargs]
|
326
|
+
) -> ResponseContextManager | FastResponse:
|
292
327
|
"""Sends a PUT request"""
|
293
328
|
return self.request("PUT", url, data=data, **kwargs)
|
294
329
|
|
locust/webui/dist/auth.html
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
<meta name="theme-color" content="#000000" />
|
8
8
|
|
9
9
|
<title>Locust</title>
|
10
|
-
<script type="module" crossorigin src="./assets/index-
|
10
|
+
<script type="module" crossorigin src="./assets/index-e9ad42b4.js"></script>
|
11
11
|
</head>
|
12
12
|
<body>
|
13
13
|
<div id="root"></div>
|
locust/webui/dist/index.html
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
<meta name="theme-color" content="#000000" />
|
8
8
|
|
9
9
|
<title>Locust</title>
|
10
|
-
<script type="module" crossorigin src="./assets/index-
|
10
|
+
<script type="module" crossorigin src="./assets/index-e9ad42b4.js"></script>
|
11
11
|
</head>
|
12
12
|
<body>
|
13
13
|
<div id="root"></div>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
locust/__init__.py,sha256=Hmw2vNf75eLQ1mQIPXAwlQrJ_XFY65MOb92fGsNCukQ,1458
|
2
2
|
locust/__main__.py,sha256=vBQ82334kX06ImDbFlPFgiBRiLIinwNk3z8Khs6hd74,31
|
3
|
-
locust/_version.py,sha256=
|
3
|
+
locust/_version.py,sha256=YavhO18vJKba7ORlLdQVf4D1EDgW-jjeaJqzbttnXjY,428
|
4
4
|
locust/argument_parser.py,sha256=sjQoJ1NTac9LdNYT7zn8RajlWqBQs8YFNv6uRExb2gg,28941
|
5
5
|
locust/clients.py,sha256=OHPv6hBAt4gt3HI67yqyT1qrSsF8uMdCwIRu0kIsRWI,19491
|
6
6
|
locust/debug.py,sha256=We6Z9W0btkKSc7PxWmrZx-xMynvOOsKhG6jmDgQin0g,5134
|
@@ -18,7 +18,7 @@ locust/shape.py,sha256=t-lwBS8LOjWcKXNL7j2U3zroIXJ1b0fazUwpRYQOKXw,1973
|
|
18
18
|
locust/stats.py,sha256=5jx9aD9Sky-kCZ3E-MjRT3xbwvxo9xyDtfcfP56zclo,45875
|
19
19
|
locust/web.py,sha256=rN1NVeZ9LKSEeDwvpRbOJ0bcy8U1U4VjP-7vK7ejlwM,27367
|
20
20
|
locust/contrib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
21
|
-
locust/contrib/fasthttp.py,sha256=
|
21
|
+
locust/contrib/fasthttp.py,sha256=tcCeXkDou-WlQwdXhj0Wt29sS9gDrqyA2aA9BMqTzeY,28501
|
22
22
|
locust/rpc/__init__.py,sha256=nVGoHWFQxZjnhCDWjbgXIbmFbN9sizAjkhvSs9_642c,58
|
23
23
|
locust/rpc/protocol.py,sha256=n-rb3GZQcAlldYDj4E4GuFGylYj_26GSS5U29meft5Y,1282
|
24
24
|
locust/rpc/zmqrpc.py,sha256=AAY6w7wSFHsW34qqN28666boHFf6dTSAXPQJnAO6iUI,2707
|
@@ -65,15 +65,14 @@ locust/util/exception_handler.py,sha256=jTMyBq2a0O07fRjmqGkheyaPj58tUgnbbcjoesKG
|
|
65
65
|
locust/util/load_locustfile.py,sha256=hn70KcIG8jHmZyuKv2pcEmwgWtOEu24Efeji1KRYNUE,2964
|
66
66
|
locust/util/rounding.py,sha256=5haxR8mKhATqag6WvPby-MSRRgIw5Ob6thbyvMYZM7o,92
|
67
67
|
locust/util/timespan.py,sha256=Y0LtnhUq2Mq19p04u0XtBlYQ_-S2cRvwRdgru8W9WhA,986
|
68
|
-
locust/webui/dist/auth.html,sha256=
|
69
|
-
locust/webui/dist/index.html,sha256=
|
68
|
+
locust/webui/dist/auth.html,sha256=NE_pYWbFjnBEkq2tG5mS_9YoL7JHX4Gkx9zhQoxlSC8,501
|
69
|
+
locust/webui/dist/index.html,sha256=S78UvAUZbQ-sH0wBxqFKrT2ZSfRxUFGx5xwQY6FaVMk,507
|
70
70
|
locust/webui/dist/report.html,sha256=sOdZZVgZbqgu86BBCSQf3uQUYXgmgSnXF32JpnyAII8,513
|
71
71
|
locust/webui/dist/assets/favicon.ico,sha256=IUl-rYqfpHdV38e-s0bkmFIeLS-n3Ug0DQxk-h202hI,8348
|
72
|
-
locust/webui/dist/assets/index-84c63e70.js,sha256=cwyH4ju0OCRvFhg3O-0SYVBTFlN_XQeQ6YkymAO4Hco,1647185
|
73
72
|
locust/webui/dist/assets/logo.png,sha256=EIVPqr6wE_yqguHaqFHIsH0ZACLSrvNWyYO7PbyIj4w,19299
|
74
|
-
locust-2.29.2.
|
75
|
-
locust-2.29.2.
|
76
|
-
locust-2.29.2.
|
77
|
-
locust-2.29.2.
|
78
|
-
locust-2.29.2.
|
79
|
-
locust-2.29.2.
|
73
|
+
locust-2.29.2.dev10.dist-info/LICENSE,sha256=78XGpIn3fHVBfaxlPNUfjVufSN7QsdhpJMRJHv2AFpo,1095
|
74
|
+
locust-2.29.2.dev10.dist-info/METADATA,sha256=GOOGcZMIDpZWsdNzHeM5B_oGHm492YESszucZMKEIzk,7390
|
75
|
+
locust-2.29.2.dev10.dist-info/WHEEL,sha256=mguMlWGMX-VHnMpKOjjQidIo1ssRlCFu4a4mBpz1s2M,91
|
76
|
+
locust-2.29.2.dev10.dist-info/entry_points.txt,sha256=RAdt8Ku-56m7bFjmdj-MBhbF6h4NX7tVODR9QNnOg0E,44
|
77
|
+
locust-2.29.2.dev10.dist-info/top_level.txt,sha256=XSsjgPA8Ggf9TqKVbkwSqZFuPlZ085X13M9orDycE20,7
|
78
|
+
locust-2.29.2.dev10.dist-info/RECORD,,
|