mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-16 02:02:58 -07:00
Update cheroot-8.5.2
This commit is contained in:
parent
4ac151d7de
commit
182e5f553e
25 changed files with 2171 additions and 602 deletions
|
@ -1,4 +1,4 @@
|
|||
"""self-explanatory."""
|
||||
"""Tests for :py:mod:`cheroot.makefile`."""
|
||||
|
||||
from cheroot import makefile
|
||||
|
||||
|
@ -7,14 +7,14 @@ __metaclass__ = type
|
|||
|
||||
|
||||
class MockSocket:
|
||||
"""Mocks a socket."""
|
||||
"""A mock socket."""
|
||||
|
||||
def __init__(self):
|
||||
"""Initialize."""
|
||||
"""Initialize :py:class:`MockSocket`."""
|
||||
self.messages = []
|
||||
|
||||
def recv_into(self, buf):
|
||||
"""Simulate recv_into for Python 3."""
|
||||
"""Simulate ``recv_into`` for Python 3."""
|
||||
if not self.messages:
|
||||
return 0
|
||||
msg = self.messages.pop(0)
|
||||
|
@ -23,7 +23,7 @@ class MockSocket:
|
|||
return len(msg)
|
||||
|
||||
def recv(self, size):
|
||||
"""Simulate recv for Python 2."""
|
||||
"""Simulate ``recv`` for Python 2."""
|
||||
try:
|
||||
return self.messages.pop(0)
|
||||
except IndexError:
|
||||
|
@ -44,7 +44,7 @@ def test_bytes_read():
|
|||
|
||||
|
||||
def test_bytes_written():
|
||||
"""Writer should capture bytes writtten."""
|
||||
"""Writer should capture bytes written."""
|
||||
sock = MockSocket()
|
||||
sock.messages.append(b'foo')
|
||||
wfile = makefile.MakeFile(sock, 'w')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue