diff options
author | Tobias Brox <tobias@redpill-linpro.com> | 2021-12-30 03:52:25 +0100 |
---|---|---|
committer | Tobias Brox <tobias@redpill-linpro.com> | 2021-12-30 03:52:25 +0100 |
commit | 46f66948473dc0b0ef98525e03bdf73d43992b1d (patch) | |
tree | 74e3b2302579d0e62b39b9ff53f4785ff989660d /tests | |
parent | 64892380606729b022daeadd5d7b82b4795964a3 (diff) | |
download | calendar-cli-46f66948473dc0b0ef98525e03bdf73d43992b1d.zip |
working on the new kal interface
Diffstat (limited to 'tests')
-rw-r--r-- | tests/_setup_alias | 18 | ||||
-rwxr-xr-x | tests/test_calendar-cli.sh | 3 | ||||
-rwxr-xr-x | tests/tests.sh | 21 |
3 files changed, 24 insertions, 18 deletions
diff --git a/tests/_setup_alias b/tests/_setup_alias new file mode 100644 index 0000000..45a267c --- /dev/null +++ b/tests/_setup_alias @@ -0,0 +1,18 @@ +error() { + echo "$1" + echo "sleeping 3" + sleep 3 + exit 255 +} + +[ -z "$calendar_cli" ] && [ -x ./calendar-cli.py ] && calendar_cli=./calendar-cli.py +[ -z "$calendar_cli" ] && [ -x ../calendar-cli.py ] && calendar_cli=../calendar-cli.py +[ -z "$calendar_cli" ] && error "couldn't find ./calendar_cli.py nor ../calendar_cli.py" + +calendar_cli() { + echo " $calendar_cli $@" + output=$($calendar_cli "$@") + [ -z "$output" ] || echo $output +} + +## TODO: new kal command aka cal.py
\ No newline at end of file diff --git a/tests/test_calendar-cli.sh b/tests/test_calendar-cli.sh index f986f12..6d22973 100755 --- a/tests/test_calendar-cli.sh +++ b/tests/test_calendar-cli.sh @@ -12,6 +12,7 @@ if [ -n "$radicale_pid" ] then echo "## Radicale now running on pid $radicale_pid" calendar_cli="../calendar-cli --caldav-url=http://localhost:5232/ --caldav-user=testuser --calendar-url=/testuser/calendar-cli-test-calendar" + kal="../cal.py --caldav-url=http://localhost:5232/ --caldav-user=testuser --calendar-url=/testuser/calendar-cli-test-calendar" echo "## Creating a calendar" $calendar_cli calendar create calendar-cli-test-calendar @@ -30,8 +31,6 @@ fi echo "########################################################################" echo "## XANDIKOS" echo "########################################################################" -echo "Not supported at the moment (xandikos dev decided to return a 500 telling that expand doesn't work when I prodded them that it didn't work. should maybe try to create a workaround)" -exit 0 xandikos_bin=$(which xandikos 2> /dev/null) if [ -n "$xandikos_bin" ] then diff --git a/tests/tests.sh b/tests/tests.sh index 5b6b1af..f519447 100755 --- a/tests/tests.sh +++ b/tests/tests.sh @@ -6,22 +6,11 @@ set -e ## SETUP ######################################################################## -error() { - echo "$1" - echo "sleeping 3" - sleep 3 - exit 255 -} - -[ -z "$calendar_cli" ] && [ -x ./calendar-cli.py ] && calendar_cli=./calendar-cli.py -[ -z "$calendar_cli" ] && [ -x ../calendar-cli.py ] && calendar_cli=../calendar-cli.py -[ -z "$calendar_cli" ] && error "couldn't find ./calendar_cli.py nor ../calendar_cli.py" - -calendar_cli() { - echo " $calendar_cli $@" - output=$($calendar_cli "$@") - [ -z "$output" ] || echo $output -} +for path in . .. ./tests ../tests +do + setup="$path/_setup_alias" + [ -x $setup ] && source $setup +done echo "## CLEANUP from earlier failed test runs" |