OXIESEC PANEL
- Current Dir:
/
/
opt
/
gsutil
/
third_party
/
urllib3
/
test
Server IP: 2a02:4780:11:1594:0:ef5:22d7:a
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
12/11/2024 09:39:44 AM
rwxr-xr-x
📄
__init__.py
10.11 KB
06/17/2024 08:00:39 AM
rw-r--r--
📄
conftest.py
12.06 KB
06/17/2024 08:00:39 AM
rw-r--r--
📁
contrib
-
06/17/2024 08:00:39 AM
rwxr-xr-x
📄
port_helpers.py
6.08 KB
06/17/2024 08:00:39 AM
rw-r--r--
📄
test_collections.py
13.97 KB
06/17/2024 08:00:39 AM
rw-r--r--
📄
test_compatibility.py
692 bytes
06/17/2024 08:00:39 AM
rw-r--r--
📄
test_connection.py
12.46 KB
06/17/2024 08:00:39 AM
rw-r--r--
📄
test_connectionpool.py
22.24 KB
06/17/2024 08:00:39 AM
rw-r--r--
📄
test_exceptions.py
2.11 KB
06/17/2024 08:00:39 AM
rw-r--r--
📄
test_fields.py
4.33 KB
06/17/2024 08:00:39 AM
rw-r--r--
📄
test_filepost.py
3.66 KB
06/17/2024 08:00:39 AM
rw-r--r--
📄
test_no_ssl.py
978 bytes
06/17/2024 08:00:39 AM
rw-r--r--
📄
test_poolmanager.py
18.36 KB
06/17/2024 08:00:39 AM
rw-r--r--
📄
test_proxymanager.py
3.57 KB
06/17/2024 08:00:39 AM
rw-r--r--
📄
test_queue_monkeypatch.py
761 bytes
06/17/2024 08:00:39 AM
rw-r--r--
📄
test_response.py
56.37 KB
06/17/2024 08:00:39 AM
rw-r--r--
📄
test_retry.py
16.32 KB
06/17/2024 08:00:39 AM
rw-r--r--
📄
test_ssl.py
7.63 KB
06/17/2024 08:00:39 AM
rw-r--r--
📄
test_ssltransport.py
20.63 KB
06/17/2024 08:00:39 AM
rw-r--r--
📄
test_util.py
42.74 KB
06/17/2024 08:00:39 AM
rw-r--r--
📄
test_wait.py
5.86 KB
06/17/2024 08:00:39 AM
rw-r--r--
📄
tz_stub.py
1.16 KB
06/17/2024 08:00:39 AM
rw-r--r--
📁
with_dummyserver
-
06/17/2024 08:00:39 AM
rwxr-xr-x
Editing: test_exceptions.py
Close
from __future__ import annotations import pickle from email.errors import MessageDefect from test import DUMMY_POOL import pytest from urllib3.connection import HTTPConnection from urllib3.connectionpool import HTTPConnectionPool from urllib3.exceptions import ( ClosedPoolError, ConnectTimeoutError, EmptyPoolError, HeaderParsingError, HostChangedError, HTTPError, LocationParseError, MaxRetryError, NewConnectionError, ReadTimeoutError, ) class TestPickle: @pytest.mark.parametrize( "exception", [ HTTPError(None), MaxRetryError(DUMMY_POOL, "", None), LocationParseError(""), ConnectTimeoutError(None), HTTPError("foo"), HTTPError("foo", IOError("foo")), MaxRetryError(HTTPConnectionPool("localhost"), "/", None), LocationParseError("fake location"), ClosedPoolError(HTTPConnectionPool("localhost"), ""), EmptyPoolError(HTTPConnectionPool("localhost"), ""), HostChangedError(HTTPConnectionPool("localhost"), "/", 0), ReadTimeoutError(HTTPConnectionPool("localhost"), "/", ""), ], ) def test_exceptions(self, exception: Exception) -> None: result = pickle.loads(pickle.dumps(exception)) assert isinstance(result, type(exception)) class TestFormat: def test_header_parsing_errors(self) -> None: hpe = HeaderParsingError([MessageDefect("defects")], "unparsed_data") assert "defects" in str(hpe) assert "unparsed_data" in str(hpe) class TestNewConnectionError: def test_pool_property_deprecation_warning(self) -> None: err = NewConnectionError(HTTPConnection("localhost"), "test") with pytest.warns(DeprecationWarning) as records: err_pool = err.pool assert err_pool is err.conn msg = ( "The 'pool' property is deprecated and will be removed " "in urllib3 v2.1.0. Use 'conn' instead." ) record = records[0] assert isinstance(record.message, Warning) assert record.message.args[0] == msg