This repository was archived by the owner on Jan 13, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed
Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change 99from ..packages .rfc3986 .uri import URIReference
1010import re
1111
12+
1213def to_bytestring (element ):
1314 """
1415 Converts a single string to a bytestring, encoding via UTF-8 if needed.
@@ -28,6 +29,7 @@ def to_bytestring_tuple(*x):
2829 """
2930 return tuple (imap (to_bytestring , x ))
3031
32+
3133def to_host_port_tuple (host_port_str , default_port = 80 ):
3234 """
3335 Converts the given string containing a host and possibly a port
Original file line number Diff line number Diff line change 2929from io import BytesIO
3030import hyper
3131
32+
3233def decode_frame (frame_data ):
3334 f , length = Frame .parse_frame_header (frame_data [:9 ])
3435 f .parse_body (memoryview (frame_data [9 :9 + length ]))
@@ -526,6 +527,7 @@ def test_that_using_proxy_keeps_http_headers_intact(self):
526527 (b':path' , b'/' ),
527528 ]
528529
530+
529531class TestServerPush (object ):
530532 def setup_method (self , method ):
531533 self .frames = []
@@ -1481,6 +1483,7 @@ def test_connection_error_when_send_out_of_range_frame(self):
14811483 with pytest .raises (ValueError ):
14821484 c ._send_cb (d )
14831485
1486+
14841487# Some utility classes for the tests.
14851488class NullEncoder (object ):
14861489 @staticmethod
@@ -1497,13 +1500,15 @@ def to_str(v):
14971500 return '\n ' .join ("%s%s" % (to_str (name ), to_str (val ))
14981501 for name , val in headers )
14991502
1503+
15001504class FixedDecoder (object ):
15011505 def __init__ (self , result ):
15021506 self .result = result
15031507
15041508 def decode (self , headers ):
15051509 return self .result
15061510
1511+
15071512class DummySocket (object ):
15081513 def __init__ (self ):
15091514 self .queue = []
You can’t perform that action at this time.
0 commit comments