@@ -23,6 +23,7 @@ def get_data(host, port):
23
23
"response" : {
24
24
"method" : "GET" ,
25
25
"url" : f"http://{ host } :{ port } /404" ,
26
+ "headers" : {"x" : "foo" },
26
27
"body" : "404 Not Found" ,
27
28
"status" : 404 ,
28
29
"content_type" : "text/plain" ,
@@ -33,6 +34,7 @@ def get_data(host, port):
33
34
"response" : {
34
35
"method" : "GET" ,
35
36
"url" : f"http://{ host } :{ port } /status/wrong" ,
37
+ "headers" : {"x" : "foo" },
36
38
"body" : "Invalid status code" ,
37
39
"status" : 400 ,
38
40
"content_type" : "text/plain" ,
@@ -43,6 +45,7 @@ def get_data(host, port):
43
45
"response" : {
44
46
"method" : "GET" ,
45
47
"url" : f"http://{ host } :{ port } /500" ,
48
+ "headers" : {"x" : "foo" },
46
49
"body" : "500 Internal Server Error" ,
47
50
"status" : 500 ,
48
51
"content_type" : "text/plain" ,
@@ -89,7 +92,6 @@ def run():
89
92
90
93
with open (self .out_file ) as file :
91
94
data = yaml .safe_load (file )
92
-
93
95
assert data == get_data (httpserver .host , httpserver .port )
94
96
95
97
def test_recorder_toml (self , httpserver ):
@@ -122,16 +124,27 @@ def run():
122
124
123
125
def prepare_server (self , httpserver ):
124
126
httpserver .expect_request ("/500" ).respond_with_data (
125
- "500 Internal Server Error" , status = 500 , content_type = "text/plain"
127
+ "500 Internal Server Error" ,
128
+ status = 500 ,
129
+ content_type = "text/plain" ,
130
+ headers = {"x" : "foo" },
126
131
)
127
132
httpserver .expect_request ("/202" ).respond_with_data (
128
- "OK" , status = 202 , content_type = "text/plain"
133
+ "OK" ,
134
+ status = 202 ,
135
+ content_type = "text/plain" ,
129
136
)
130
137
httpserver .expect_request ("/404" ).respond_with_data (
131
- "404 Not Found" , status = 404 , content_type = "text/plain"
138
+ "404 Not Found" ,
139
+ status = 404 ,
140
+ content_type = "text/plain" ,
141
+ headers = {"x" : "foo" },
132
142
)
133
143
httpserver .expect_request ("/status/wrong" ).respond_with_data (
134
- "Invalid status code" , status = 400 , content_type = "text/plain"
144
+ "Invalid status code" ,
145
+ status = 400 ,
146
+ content_type = "text/plain" ,
147
+ headers = {"x" : "foo" },
135
148
)
136
149
url500 = httpserver .url_for ("/500" )
137
150
url202 = httpserver .url_for ("/202" )
0 commit comments