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 9
9
from ..packages .rfc3986 .uri import URIReference
10
10
import re
11
11
12
+
12
13
def to_bytestring (element ):
13
14
"""
14
15
Converts a single string to a bytestring, encoding via UTF-8 if needed.
@@ -28,6 +29,7 @@ def to_bytestring_tuple(*x):
28
29
"""
29
30
return tuple (imap (to_bytestring , x ))
30
31
32
+
31
33
def to_host_port_tuple (host_port_str , default_port = 80 ):
32
34
"""
33
35
Converts the given string containing a host and possibly a port
Original file line number Diff line number Diff line change 29
29
from io import BytesIO
30
30
import hyper
31
31
32
+
32
33
def decode_frame (frame_data ):
33
34
f , length = Frame .parse_frame_header (frame_data [:9 ])
34
35
f .parse_body (memoryview (frame_data [9 :9 + length ]))
@@ -526,6 +527,7 @@ def test_that_using_proxy_keeps_http_headers_intact(self):
526
527
(b':path' , b'/' ),
527
528
]
528
529
530
+
529
531
class TestServerPush (object ):
530
532
def setup_method (self , method ):
531
533
self .frames = []
@@ -1481,6 +1483,7 @@ def test_connection_error_when_send_out_of_range_frame(self):
1481
1483
with pytest .raises (ValueError ):
1482
1484
c ._send_cb (d )
1483
1485
1486
+
1484
1487
# Some utility classes for the tests.
1485
1488
class NullEncoder (object ):
1486
1489
@staticmethod
@@ -1497,13 +1500,15 @@ def to_str(v):
1497
1500
return '\n ' .join ("%s%s" % (to_str (name ), to_str (val ))
1498
1501
for name , val in headers )
1499
1502
1503
+
1500
1504
class FixedDecoder (object ):
1501
1505
def __init__ (self , result ):
1502
1506
self .result = result
1503
1507
1504
1508
def decode (self , headers ):
1505
1509
return self .result
1506
1510
1511
+
1507
1512
class DummySocket (object ):
1508
1513
def __init__ (self ):
1509
1514
self .queue = []
You can’t perform that action at this time.
0 commit comments