-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
introduce uploadConditions unit test
- Loading branch information
Showing
2 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
|
||
check_for_success() { | ||
"${@}" && echo -e "\n ---> Passed test of '${@}'\n\n" || exit 1 | ||
} | ||
|
||
check_for_failure() { | ||
"${@}" && exit 1 || echo -e "\n ---> Passed test of '${@}'\n\n" | ||
} | ||
|
||
######################################## | ||
# Test help function | ||
######################################## | ||
check_for_success uploadConditions.py --help | ||
|
||
######################################## | ||
# Test wizard | ||
######################################## | ||
if test -f "BasicPayload_v0.txt"; then | ||
rm -f BasicPayload_v0.txt | ||
fi | ||
cat <<EOF >> BasicPayload_v0.txt | ||
{ | ||
"destinationDatabase": "ANYTHIGHEREWILLDO", | ||
"destinationTags": { | ||
"BasicPayload_v0": {} | ||
}, | ||
"inputTag": "BasicPayload_v0", | ||
"since": null, | ||
"userText": "test wizard" | ||
} | ||
EOF | ||
|
||
echo "content of the directory is:" `ls -lh . | grep db` | ||
check_for_failure uploadConditions.py BasicPayload_v0.db |