Skip to content

Commit 27bbccc

Browse files
committed
fixup! Rewrite test codes to replace httpretty with responses
1 parent 86c217d commit 27bbccc

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

tests/unit/test_client.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -551,13 +551,12 @@ def test_oauth2_header_parsing(header, sample_post_response_data):
551551
token_server = f"{TOKEN_RESOURCE}/{challenge_id}"
552552

553553
# noinspection PyUnusedLocal
554-
# def post_statement(request, uri, response_headers): # FIXME
555-
def post_statement(request):
554+
def post_statement(request, uri, response_headers):
556555
authorization = request.headers.get("Authorization")
557556
if authorization and authorization.replace("Bearer ", "") in token:
558-
return (200, {}, json.dumps(sample_post_response_data))
559-
return (401, {'Www-Authenticate': header.format(redirect_server=redirect_server, token_server=token_server),
560-
'Basic realm': '"Trino"'}, "")
557+
return [200, response_headers, json.dumps(sample_post_response_data)]
558+
return [401, {'Www-Authenticate': header.format(redirect_server=redirect_server, token_server=token_server),
559+
'Basic realm': '"Trino"'}, ""]
561560

562561
# bind post statement
563562
responses.add_callback(

0 commit comments

Comments
 (0)