mirror of
https://codeberg.org/SeedDMS/paperless
synced 2024-11-26 07:22:08 +00:00
add various test shell scripts
This commit is contained in:
parent
ed9c01e05a
commit
5b37300aa8
5
tests/README.md
Normal file
5
tests/README.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
Create a file credentials and define AUTH and URL in it.
|
||||||
|
URL is the base url of the restapi service. AUTH are the credentials
|
||||||
|
as pass in http header Authorization. It can be ab basic authentication,
|
||||||
|
a papeerless or a regular SeedDMS token.
|
||||||
|
|
6
tests/test-api.sh
Executable file
6
tests/test-api.sh
Executable file
|
@ -0,0 +1,6 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
. ./credentials
|
||||||
|
|
||||||
|
curl --silent "${URL}/api/" -H "Authorization: ${AUTH}" | jq '.'
|
||||||
|
|
7
tests/test-autocomplete.sh
Executable file
7
tests/test-autocomplete.sh
Executable file
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
. ./credentials
|
||||||
|
|
||||||
|
curl --silent "${URL}/api/search/autocomplete/?term=wa" -H "Authorization: ${AUTH}"
|
||||||
|
#| jq '.'
|
||||||
|
|
7
tests/test-delete-saved-views.sh
Executable file
7
tests/test-delete-saved-views.sh
Executable file
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
. ./credentials
|
||||||
|
|
||||||
|
curl -v -X DELETE "${URL}/api/saved_views/3/" -H "Authorization: ${AUTH}"
|
||||||
|
#| jq '.'
|
||||||
|
|
7
tests/test-delete.sh
Executable file
7
tests/test-delete.sh
Executable file
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
. ./credentials
|
||||||
|
|
||||||
|
curl -v -X DELETE "${URL}/api/documents/23761/" -H "Authorization: ${AUTH}"
|
||||||
|
#| jq '.'
|
||||||
|
|
5
tests/test-document-download.sh
Executable file
5
tests/test-document-download.sh
Executable file
|
@ -0,0 +1,5 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
. ./credentials
|
||||||
|
|
||||||
|
curl -L --silent "${URL}/fetch/doc/23311" -H "Authorization: ${AUTH}" --output 23311.pdf
|
6
tests/test-document-metadata.sh
Executable file
6
tests/test-document-metadata.sh
Executable file
|
@ -0,0 +1,6 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
. ./credentials
|
||||||
|
|
||||||
|
curl --silent "${URL}/api/documents/23768/metadata/" -H "Authorization: ${AUTH}" | jq '.'
|
||||||
|
|
7
tests/test-document-thumb.sh
Executable file
7
tests/test-document-thumb.sh
Executable file
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
. ./credentials
|
||||||
|
|
||||||
|
DOCID=19263
|
||||||
|
|
||||||
|
curl -L --silent "${URL}/fetch/thumb/${DOCID}" -H "Authorization: ${AUTH}" --output ${DOCID}.png
|
6
tests/test-documents.sh
Executable file
6
tests/test-documents.sh
Executable file
|
@ -0,0 +1,6 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
. ./credentials
|
||||||
|
|
||||||
|
curl --silent "${URL}/api/documents/?format=json&query=added:%5B-70%20day%20to%20now%5D&is_tagged=0&page=3&page_size=5&ordering=-added" -H "Authorization: ${AUTH}" | jq '.'
|
||||||
|
#curl --silent "${URL}/api/documents/?format=json&query=barbaradio&page=3&page_size=5&ordering=-added" -H "Authorization: ${AUTH}" | jq '.'
|
10
tests/test-post-saved-view.sh
Executable file
10
tests/test-post-saved-view.sh
Executable file
|
@ -0,0 +1,10 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
. ./credentials
|
||||||
|
|
||||||
|
curl --silent -X POST "${URL}/api/saved_views/" \
|
||||||
|
-H 'Content-Type: application/json' \
|
||||||
|
-H "Authorization: ${AUTH}" \
|
||||||
|
-d '{"id":0,"name":"autoview","username":"admin","password":"admin"}'
|
||||||
|
# | jq '.'
|
||||||
|
|
6
tests/test-saved-views.sh
Executable file
6
tests/test-saved-views.sh
Executable file
|
@ -0,0 +1,6 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
. ./credentials
|
||||||
|
|
||||||
|
curl --silent "${URL}/api/saved_views/" -H "Authorization: ${AUTH}" | jq '.'
|
||||||
|
|
6
tests/test-statstotal.sh
Executable file
6
tests/test-statstotal.sh
Executable file
|
@ -0,0 +1,6 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
. ./credentials
|
||||||
|
|
||||||
|
curl --silent "${URL}/api/statstotal/" -H "Authorization: ${AUTH}" | jq '.'
|
||||||
|
|
7
tests/test-tags.sh
Executable file
7
tests/test-tags.sh
Executable file
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
. ./credentials
|
||||||
|
|
||||||
|
curl --silent "${URL}/api/tags/" -H "Authorization: ${AUTH}"
|
||||||
|
#| jq '.'
|
||||||
|
|
8
tests/test-token.sh
Executable file
8
tests/test-token.sh
Executable file
|
@ -0,0 +1,8 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
. ./credentials
|
||||||
|
|
||||||
|
curl --silent -X POST "${URL}/api/token/" \
|
||||||
|
-H 'Content-Type: application/json' \
|
||||||
|
-d '{"username":"admin","password":"admin"}' | jq '.'
|
||||||
|
|
7
tests/test-upload.sh
Executable file
7
tests/test-upload.sh
Executable file
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
. ./credentials
|
||||||
|
|
||||||
|
curl -v -X POST -F "file=@test-upload.sh" -F "tags=5" "${URL}/api/documents/post_document/" -H "Authorization: ${AUTH}"
|
||||||
|
#| jq '.'
|
||||||
|
|
Loading…
Reference in New Issue
Block a user