Skip to content

Commit d29d74e

Browse files
committed
test: Simplify handler test.
1 parent 2eb4d66 commit d29d74e

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

tests/faas/test_start.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,18 @@ def test_full_response(self):
4444
mock_func = Mock()
4545
mock_response = Response(
4646
data="it works".encode(),
47-
context=ResponseContext(
48-
context=HttpResponseContext(headers={"a": "a header", "b": "b header"}, status=200)
49-
),
47+
context=ResponseContext(context=HttpResponseContext(headers={"a": "a header"}, status=200)),
5048
)
5149
mock_func.return_value = mock_response
5250

53-
returnBody = json_format.MessageToJson(mock_response.to_grpc_trigger_response_context())
51+
return_body = json_format.MessageToJson(mock_response.to_grpc_trigger_response_context())
5452

5553
with patch("nitric.faas.faas.construct_request", Mock()):
5654
handler = Handler(mock_func)
5755
response = handler()
5856

5957
# Ensure the response is returned in the tuple format for Flask
60-
assert response == (returnBody, 200, {"Content-Type": "application/json"})
58+
assert response == (return_body, 200, {"Content-Type": "application/json"})
6159

6260
def test_unhandled_exception(self):
6361
# always return and error to test how it's handled internally

0 commit comments

Comments
 (0)