and self.verify == other.verify
)
- def __hash__(self) -> int:
- as_tuple = (self.cert, self.verify)
- return hash(as_tuple)
-
def __repr__(self) -> str:
class_name = self.__class__.__name__
return f"{class_name}(cert={self.cert}, verify={self.verify})"
and self.pool_timeout == other.pool_timeout
)
- def __hash__(self) -> int:
- as_tuple = (
- self.connect_timeout,
- self.read_timeout,
- self.write_timeout,
- self.pool_timeout,
- )
- return hash(as_tuple)
-
def __repr__(self) -> str:
class_name = self.__class__.__name__
if self.timeout is not None:
and self.hard_limit == other.hard_limit
)
- def __hash__(self) -> int:
- as_tuple = (self.soft_limit, self.hard_limit)
- return hash(as_tuple)
-
def __repr__(self) -> str:
class_name = self.__class__.__name__
return (
def test_limits_eq():
limits = httpcore.PoolLimits(hard_limit=100)
assert limits == httpcore.PoolLimits(hard_limit=100)
-
-
-def test_ssl_hash():
- cache = {}
- ssl = httpcore.SSLConfig(verify=False)
- cache[ssl] = "example"
- assert cache[httpcore.SSLConfig(verify=False)] == "example"
-
-
-def test_timeout_hash():
- cache = {}
- timeout = httpcore.TimeoutConfig(timeout=5.0)
- cache[timeout] = "example"
- assert cache[httpcore.TimeoutConfig(timeout=5.0)] == "example"
-
-
-def test_limits_hash():
- cache = {}
- limits = httpcore.PoolLimits(hard_limit=100)
- cache[limits] = "example"
- assert cache[httpcore.PoolLimits(hard_limit=100)] == "example"