diff options
author | Benjamin Brahmer <info@b-brahmer.de> | 2022-05-29 11:25:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-29 11:25:38 +0200 |
commit | eca96ad37d89b442ae4e0463ec8f7a5bee3007f1 (patch) | |
tree | 81b9e611ea846b9931016cea3bc9dcaa1c85e4a1 /tests/command/opml.bats | |
parent | 86e01a91f3b3fa1220adb899fa56b8bd53720d34 (diff) |
Enable API testing (#1699)
Enable API testing with local php server.
This adds many tests for API v1.2, more still possible.
Which increased the quality of news already.
Signed-off-by: Benjamin Brahmer <info@b-brahmer.de>
Diffstat (limited to 'tests/command/opml.bats')
-rw-r--r-- | tests/command/opml.bats | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/command/opml.bats b/tests/command/opml.bats new file mode 100644 index 000000000..b2d576e8e --- /dev/null +++ b/tests/command/opml.bats @@ -0,0 +1,26 @@ +#!/usr/bin/env bats + +load "helpers/settings" + +TESTSUITE="OPML" + +teardown() { + ID=$(./occ news:feed:list 'admin' | grep "Something-${BATS_SUITE_TEST_NUMBER}" -1 | head -1 | grep -oE '[0-9]*') + if [ -n "$ID" ]; then + ./occ news:feed:delete "$user" "$ID" + fi +} + +@test "[$TESTSUITE] Export" { + run ./occ news:feed:add "$user" "https://nextcloud.com/blog/static-feed/" + [ "$status" -eq 0 ] + + run ./occ news:opml:export "$user" + [ "$status" -eq 0 ] + + if ! echo "$output" | grep "https://nextcloud.com/"; then + ret_status=$? + echo "Feed not exported" + return $ret_status + fi +}
\ No newline at end of file |