@@ -85,14 +85,37 @@ def test_receivebuffer():
8585@pytest .mark .parametrize (
8686 "data" ,
8787 [
88- (
89- b"HTTP/1.1 200 OK\r \n " ,
90- b"Content-type: text/plain\r \n " ,
91- b"\r \n " ,
92- b"Some body" ,
88+ pytest .param (
89+ (
90+ b"HTTP/1.1 200 OK\r \n " ,
91+ b"Content-type: text/plain\r \n " ,
92+ b"\r \n " ,
93+ b"Some body" ,
94+ ),
95+ id = "with_crlf_delimiter" ,
96+ ),
97+ pytest .param (
98+ (b"HTTP/1.1 200 OK\n " , b"Content-type: text/plain\n " , b"\n " , b"Some body" ),
99+ id = "with_lf_only_delimiter" ,
100+ ),
101+ pytest .param (
102+ (
103+ b"HTTP/1.1 200 OK\r \n " ,
104+ b"Content-type: text/plain\n " ,
105+ b"\n " ,
106+ b"Some body" ,
107+ ),
108+ id = "with_double_lf_before_body" ,
109+ ),
110+ pytest .param (
111+ (
112+ b"HTTP/1.1 200 OK\r \n " ,
113+ b"Content-type: text/plain\r \n " ,
114+ b"\n " ,
115+ b"Some body" ,
116+ ),
117+ id = "with_mixed_crlf" ,
93118 ),
94- (b"HTTP/1.1 200 OK\n " , b"Content-type: text/plain\n " , b"\n " , b"Some body" ),
95- (b"HTTP/1.1 200 OK\r \n " , b"Content-type: text/plain\n " , b"\n " , b"Some body" ),
96119 ],
97120)
98121def test_receivebuffer_for_invalid_delimiter (data ):
0 commit comments