test(fixtures): add check for status code
This commit is contained in:
parent
191fa48b21
commit
075fc84091
|
@ -13,6 +13,8 @@ run_test() {
|
|||
test "$content" = "$(curl -s $file_url)"
|
||||
file_url=$(curl -s -F "file=@file" -H "filename:fn_from_header.txt" localhost:8000)
|
||||
test "$file_url" = "file already exists"
|
||||
status_code=$(curl -s -F "file=@file" -H "filename:fn_from_header.txt" -w "%{response_code}" -o /dev/null localhost:8000)
|
||||
test "$status_code" = "409"
|
||||
}
|
||||
|
||||
teardown() {
|
||||
|
|
|
@ -11,6 +11,7 @@ setup() {
|
|||
run_test() {
|
||||
test "this file type is not permitted" = "$(curl -s -F "file=@file.html" localhost:8000)"
|
||||
test "this file type is not permitted" = "$(curl -s -F "file=@file.xml" localhost:8000)"
|
||||
test "415" = "$(curl -s -F "file=@file.xml" -w "%{response_code}" -o /dev/null localhost:8000)"
|
||||
file_url=$(curl -s -F "file=@file.txt" localhost:8000)
|
||||
test "$content" = "$(curl -s $file_url)"
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue