Skip to content

Commit

Permalink
Update rest tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximPlusov committed Feb 13, 2024
1 parent bfa24b8 commit 1ea5037
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions tests/Options/config/app/format.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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 "<name>Mustang_505.pdf</name>"

[ "$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 ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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=
Expand Down

0 comments on commit 1ea5037

Please sign in to comment.