Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Commit f9c228d

Browse files
committed
Revert "solve emtpy space issues"
This reverts commit c55806c.
1 parent 0d5bb52 commit f9c228d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/http/tests.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
import json
33

44
def make_request(method, path, headers=None, data=None):
5-
headerstr = "-h {}" if headers is None else f" -h \"{headers}\""
6-
datastr = "" if data is None else f" -d \"{data}\""
7-
response_string = os.popen(fr'sh run.sh -m {method} -u http://localhost:8080{path} {headerstr} {datastr}').read()
5+
headerstr = "-h {}" if headers is None else f" -h {headers}"
6+
datastr = "" if data is None else f" -d {data}"
7+
response_string = os.popen(f"sh run.sh -m {method} -u http://localhost:8080{path} {headerstr} {datastr}").read()
88
return json.loads(response_string) # JSON con campos status, body y headers
99

1010
# Almacena los resultados de las pruebas
@@ -52,7 +52,7 @@ def evaluate_response(case, expected_status, actual_status, expected_body=None,
5252
evaluate_response("GET secure with valid Authorization", 200, response['status'], "You accessed a protected resource", response['body'])
5353

5454
print_case("GET secure with invalid Authorization", "Testing GET request to '/secure' with invalid authorization")
55-
response = make_request("GET", "/secure", headers='{\\"Authorization\\":\\"Bearer\\ invalid_token\\"}')
55+
response = make_request("GET", "/secure", headers='{\\"Authorization\\":\\ \\"Bearer\\ invalid_token\\"}')
5656
evaluate_response("GET secure with invalid Authorization", 401, response['status'], "Invalid or missing authorization token", response['body'])
5757

5858
# Ajuste en PUT request
@@ -82,7 +82,7 @@ def evaluate_response(case, expected_status, actual_status, expected_body=None,
8282
response = make_request(
8383
"POST",
8484
"/secure",
85-
headers='{\\"Authorization\\": \\"Bearer\\ 12345\\",\\ \\"Content-Type\\":\\ \\"application/json\\"}',
85+
headers='{\\"Authorization\\":\\ \\"Bearer\\ 12345\\",\\ \\"Content-Type\\":\\ \\"application/json\\"}',
8686
data='{"key":}'
8787
)
8888
evaluate_response(

0 commit comments

Comments
 (0)