Skip to content

Commit

Permalink
Add test exercising actual CLI usage
Browse files Browse the repository at this point in the history
  • Loading branch information
DusanMadar committed Dec 8, 2018
1 parent 042fc4d commit 9d969a0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ script:
- python setup.py test
- coverage run -m unittest discover
- coverage report -m --include=pysyncdroid*
- bash tests/test_cli.sh

after_success:
- coveralls
Expand Down
16 changes: 16 additions & 0 deletions tests/test_cli.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

# Install the package.
python setup.py install

ACTUAL_OUTPUT="$(pysyncdroid 2>&1)"
EXPECTED_OUTPUT="usage: pysyncdroid [-h] -V VENDOR -M MODEL [-s SOURCE] [-d DESTINATION]
[-f FILE] [-v] [-u {ignore,remove,synchronize}] [-o]
[-i IGNORE_FILE_TYPE [IGNORE_FILE_TYPE ...]]
pysyncdroid: error: the following arguments are required: -V/--vendor, -M/--model"

if [ "$ACTUAL_OUTPUT" != "$EXPECTED_OUTPUT" ]
then
echo "Unexpected 'pysyncdroid' output"
exit 1
fi

0 comments on commit 9d969a0

Please sign in to comment.