Skip to content

Commit ee42ffc

Browse files
committed
Correct tests
1 parent 34a4498 commit ee42ffc

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/cache_s3.bats

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ setup() {
3737
}
3838

3939
@test 'Exists on non-existing file fails' {
40-
stub aws 'exit 1'
40+
stub aws 'echo null'
4141

4242
run "${PWD}/backends/cache_s3" exists PATH/THAT/DOES/NOT/EXIST
4343

@@ -97,10 +97,10 @@ setup() {
9797
stub aws \
9898
's3 sync --endpoint-url https://s3.somewhere.com \* \* : echo ' \
9999
's3 sync --endpoint-url https://s3.somewhere.com \* \* : echo ' \
100-
's3api list-objects-v2 --bucket \* --prefix \* --max-items 1 --endpoint-url https://s3.somewhere.com : echo exists' \
100+
's3api list-objects-v2 --bucket \* --prefix \* --max-items 1 --query Contents --endpoint-url https://s3.somewhere.com : echo exists' \
101101
's3 sync \* \* : echo ' \
102102
's3 sync \* \* : echo ' \
103-
's3api list-objects-v2 --bucket \* --prefix \* --max-items 1 : echo exists'
103+
's3api list-objects-v2 --bucket \* --prefix \* --max-items 1 --query Contents : echo exists'
104104

105105
run "${PWD}/backends/cache_s3" save from to
106106

@@ -141,7 +141,7 @@ setup() {
141141
touch "${BATS_TEST_TMPDIR}/new-file"
142142
mkdir "${BATS_TEST_TMPDIR}/s3-cache"
143143
stub aws \
144-
"echo" \
144+
"echo null" \
145145
"ln -s \$3 $BATS_TEST_TMPDIR/s3-cache/\$(echo \$4 | md5sum | cut -c-32)" \
146146
"echo 'exists'" \
147147
"cp -r $BATS_TEST_TMPDIR/s3-cache/\$(echo \$3 | md5sum | cut -c-32) \$4"
@@ -179,7 +179,7 @@ setup() {
179179
echo 'random content' > "${BATS_TEST_TMPDIR}/new-folder/new-file"
180180

181181
stub aws \
182-
"echo" \
182+
"echo null" \
183183
"ln -s \$3 $BATS_TEST_TMPDIR/s3-cache/\$(echo \$4 | md5sum | cut -c-32)" \
184184
"echo 'exists'" \
185185
"cp -r $BATS_TEST_TMPDIR/s3-cache/\$(echo \$3 | md5sum | cut -c-32) \$4"

0 commit comments

Comments
 (0)