From 1ea5037d97f663640c15e29a221d02cf88666cb5 Mon Sep 17 00:00:00 2001 From: Maxim Date: Tue, 13 Feb 2024 14:51:07 +0300 Subject: [PATCH] Update rest tests --- tests/Options/config/app/format.bats | 8 ++++---- .../services/bindMountLocalFiles/steps_in_docker.sh | 2 +- .../tests/api_validate/test_api_validate_sha_profileId.py | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/Options/config/app/format.bats b/tests/Options/config/app/format.bats index 11e788cc..849bf787 100644 --- a/tests/Options/config/app/format.bats +++ b/tests/Options/config/app/format.bats @@ -18,17 +18,17 @@ teardown() { echo -e "Done ..." >&3 } -@test "--format, Chooses output format, the default format=XML" { +@test "--format, Chooses output format, format=XML" { - run curl -F "file=@$PROJECT_ROOT/Resources/Mustang_505.pdf" localhost:8080/api/validate/1b + run curl -F "file=@$PROJECT_ROOT/Resources/Mustang_505.pdf" localhost:8080/api/validate/1b -H 'accept: application/xml' assert_output --partial "Mustang_505.pdf" [ "$status" -eq 0 ] } -@test "--format, Chooses output format, format=JSON" { +@test "--format, Chooses output format, the default format=JSON" { - run curl -F "file=@$PROJECT_ROOT/Resources/Mustang_505.pdf" localhost:8080/api/validate/1b -H 'accept: application/json' + run curl -F "file=@$PROJECT_ROOT/Resources/Mustang_505.pdf" localhost:8080/api/validate/1b assert_output --partial '"jobEndStatus" : "normal"' [ "$status" -eq 0 ] diff --git a/tests/Options/services/bindMountLocalFiles/steps_in_docker.sh b/tests/Options/services/bindMountLocalFiles/steps_in_docker.sh index 41f3f248..f87a4f5c 100755 --- a/tests/Options/services/bindMountLocalFiles/steps_in_docker.sh +++ b/tests/Options/services/bindMountLocalFiles/steps_in_docker.sh @@ -6,5 +6,5 @@ apt-get install curl -y cd /home/Res_tmp/ echo -e "\n" -curl -F "file=@/home/Res_tmp/a.pdf" localhost:8080/api/validate/3a > res_tmp_log.log +curl -F "file=@/home/Res_tmp/a.pdf" localhost:8080/api/validate/3a > res_tmp_log.log -H 'accept: application/xml' exit diff --git a/tests/rest_api/tests/api_validate/test_api_validate_sha_profileId.py b/tests/rest_api/tests/api_validate/test_api_validate_sha_profileId.py index bc131809..d77b0a6c 100644 --- a/tests/rest_api/tests/api_validate/test_api_validate_sha_profileId.py +++ b/tests/rest_api/tests/api_validate/test_api_validate_sha_profileId.py @@ -27,7 +27,7 @@ def test_api_validate_sha_profileid_check( } response = requests.post( - get_base_url + "/api/validate/sha/" + profile_id, headers=headers, files=files + get_base_url + "/api/validate/" + profile_id, headers=headers, files=files ) assert response.status_code == 200 @@ -60,7 +60,7 @@ def test_api_validate_sha_profileid_xml_check( } response = requests.post( - get_base_url + "/api/validate/sha/" + profile_id, headers=headers, files=files + get_base_url + "/api/validate/" + profile_id, headers=headers, files=files ) assert response.status_code == 200 @@ -81,7 +81,7 @@ def test_api_validate_sha_profileid_xml_check( def test_api_validate_sha_profileid_html_check( profile_id, expected_profile_name, get_base_url ): - url = get_base_url + "/api/validate/sha/" + profile_id + url = get_base_url + "/api/validate/" + profile_id headers = { "accept": "text/html", # requests won't add a boundary if this header is set when you pass files=