Skip to content

Commit 7570402

Browse files
committed
Fix flask test cases
1 parent 6f6c1f9 commit 7570402

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

aikido_zen/sources/flask/flask_test.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,11 @@ def hello(user, age):
104104
assert get_current_context().method == "POST"
105105
assert get_current_context().body is None
106106
assert get_current_context().headers == {
107-
"COOKIE": "sessionId=abc123xyz456;",
108-
"HEADER_1": "header 1 value",
109-
"HEADER_2": "Header 2 value",
110-
"HOST": "example.com",
111-
"CONTENT_TYPE": "application/json",
107+
"COOKIE": ["sessionId=abc123xyz456;"],
108+
"HEADER_1": ["header 1 value"],
109+
"HEADER_2": ["Header 2 value"],
110+
"HOST": ["example.com"],
111+
"CONTENT_TYPE": ["application/json"],
112112
}
113113
calls = mock_request_handler.call_args_list
114114
assert len(calls) == 2
@@ -175,11 +175,11 @@ def test_flask_all_3_func_with_invalid_body():
175175
get_current_context().body == None
176176
) # body is None since it's invalid json
177177
assert get_current_context().headers == {
178-
"COOKIE": "sessionId=abc123xyz456;",
179-
"HEADER_1": "header 1 value",
180-
"HEADER_2": "Header 2 value",
181-
"HOST": "example.com",
182-
"CONTENT_TYPE": "application/json",
178+
"COOKIE": ["sessionId=abc123xyz456;"],
179+
"HEADER_1": ["header 1 value"],
180+
"HEADER_2": ["Header 2 value"],
181+
"HOST": ["example.com"],
182+
"CONTENT_TYPE": ["application/json"],
183183
}
184184
calls = mock_request_handler.call_args_list
185185
assert len(calls) == 2
@@ -208,11 +208,11 @@ def test_flask_all_3_func():
208208
assert get_current_context().method == "POST"
209209
assert get_current_context().body == None
210210
assert get_current_context().headers == {
211-
"COOKIE": "sessionId=abc123xyz456;",
212-
"HEADER_1": "header 1 value",
213-
"HEADER_2": "Header 2 value",
214-
"HOST": "example.com",
215-
"CONTENT_TYPE": "application/x-www-form-urlencoded",
211+
"COOKIE": ["sessionId=abc123xyz456;"],
212+
"HEADER_1": ["header 1 value"],
213+
"HEADER_2": ["Header 2 value"],
214+
"HOST": ["example.com"],
215+
"CONTENT_TYPE": ["application/x-www-form-urlencoded"],
216216
}
217217
calls = mock_request_handler.call_args_list
218218
assert len(calls) == 2

0 commit comments

Comments
 (0)