mirror of
https://gitlab.alpinelinux.org/alpine/abuild.git
synced 2024-12-23 15:33:28 +00:00
tests: abuild-fetch: test curl failure
This commit is contained in:
parent
38a62bd063
commit
d7d4eb7d60
@ -3,7 +3,8 @@
|
||||
. $(atf_get_srcdir)/test_env.sh
|
||||
init_tests \
|
||||
abuild_fetch_help \
|
||||
abuild_fetch_curl_invocation
|
||||
abuild_fetch_curl_invocation \
|
||||
abuild_fetch_curl_failure
|
||||
|
||||
create_fake_curl() {
|
||||
mkdir bin
|
||||
@ -37,3 +38,15 @@ abuild_fetch_curl_invocation_body() {
|
||||
abuild-fetch https://example.com/non-existing
|
||||
}
|
||||
|
||||
abuild_fetch_curl_failure_body() {
|
||||
create_fake_curl
|
||||
# verify that fake curl works
|
||||
CURL_EXITCODE=1 atf_check -s exit:$CURL_EXITCODE \
|
||||
-o match:"Fake curl invoked" \
|
||||
curl
|
||||
CURL_EXITCODE=1 atf_check -s exit:$CURL_EXITCODE \
|
||||
-o match:"Fake curl invoked" \
|
||||
-e empty \
|
||||
abuild-fetch https://example.com/non-existing
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user