-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch from Mocks to VCR for more accurate test suite
- Loading branch information
1 parent
7748f21
commit 0680ce7
Showing
29 changed files
with
594 additions
and
295 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
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,3 @@ | ||
mock | ||
pytest | ||
pytest-recording |
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
46 changes: 46 additions & 0 deletions
46
tests/apis/cassettes/test_documents/TestDocuments.test_delete_documents.yaml
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,46 @@ | ||
interactions: | ||
- request: | ||
body: '[1, "2"]' | ||
headers: | ||
Accept: | ||
- '*/*' | ||
Accept-Encoding: | ||
- gzip, deflate | ||
Authorization: | ||
- Bearer 32744aeb04f1269f57376347ee1d8f4e915e8273bfa9b2036aff4ef770bd2377 | ||
Connection: | ||
- keep-alive | ||
Content-Length: | ||
- '8' | ||
Content-Type: | ||
- application/json | ||
method: POST | ||
uri: http://localhost:8080/api/ws/v1/sources/5eebbb1e5e21d6c1e64f9578/documents/bulk_destroy | ||
response: | ||
body: | ||
string: '{"results":[{"id":1,"success":true},{"id":"2","success":true}]}' | ||
headers: | ||
Cache-Control: | ||
- max-age=0, private, must-revalidate | ||
Content-Type: | ||
- application/json; charset=utf-8 | ||
ETag: | ||
- W/"77b44f941fd70bd4db8769a374c4408d" | ||
Server: | ||
- Jetty(9.2.29.v20191105) | ||
Transfer-Encoding: | ||
- chunked | ||
X-Content-Type-Options: | ||
- nosniff | ||
X-Frame-Options: | ||
- SAMEORIGIN | ||
X-Request-Id: | ||
- 95ce13bc-5e1d-46f1-aaca-6858d1d310c6 | ||
X-Runtime: | ||
- '0.164300' | ||
X-XSS-Protection: | ||
- 1; mode=block | ||
status: | ||
code: 200 | ||
message: OK | ||
version: 1 |
47 changes: 47 additions & 0 deletions
47
...s/apis/cassettes/test_documents/TestDocuments.test_delete_documents_source_not_found.yaml
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,47 @@ | ||
interactions: | ||
- request: | ||
body: '[1, 2]' | ||
headers: | ||
Accept: | ||
- '*/*' | ||
Accept-Encoding: | ||
- gzip, deflate | ||
Authorization: | ||
- Bearer 32744aeb04f1269f57376347ee1d8f4e915e8273bfa9b2036aff4ef770bd2377 | ||
Connection: | ||
- keep-alive | ||
Content-Length: | ||
- '6' | ||
Content-Type: | ||
- application/json | ||
method: POST | ||
uri: http://localhost:8080/api/ws/v1/sources/bad-source-key/documents/bulk_destroy | ||
response: | ||
body: | ||
string: '' | ||
headers: | ||
Cache-Control: | ||
- no-cache | ||
Content-Security-Policy: | ||
- script-src 'nonce-L6XvPcXkNl85q8Wwyr0rVw==' 'strict-dynamic' 'self'; object-src | ||
'none'; base-uri 'none'; frame-ancestors 'self'; | ||
Content-Type: | ||
- text/html | ||
Server: | ||
- Jetty(9.2.29.v20191105) | ||
Transfer-Encoding: | ||
- chunked | ||
X-Content-Type-Options: | ||
- nosniff | ||
X-Frame-Options: | ||
- SAMEORIGIN | ||
X-Request-Id: | ||
- 3e12a641-e82d-4639-8816-8dfa123d2200 | ||
X-Runtime: | ||
- '0.020764' | ||
X-XSS-Protection: | ||
- 1; mode=block | ||
status: | ||
code: 404 | ||
message: Not Found | ||
version: 1 |
47 changes: 47 additions & 0 deletions
47
tests/apis/cassettes/test_documents/TestDocuments.test_index_documents.yaml
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,47 @@ | ||
interactions: | ||
- request: | ||
body: '[{"id": 1, "url": "", "title": "", "body": ""}, {"id": "2", "url": "", | ||
"title": "", "body": ""}]' | ||
headers: | ||
Accept: | ||
- '*/*' | ||
Accept-Encoding: | ||
- gzip, deflate | ||
Authorization: | ||
- Bearer 32744aeb04f1269f57376347ee1d8f4e915e8273bfa9b2036aff4ef770bd2377 | ||
Connection: | ||
- keep-alive | ||
Content-Length: | ||
- '96' | ||
Content-Type: | ||
- application/json | ||
method: POST | ||
uri: http://localhost:8080/api/ws/v1/sources/5eebbb1e5e21d6c1e64f9578/documents/bulk_create | ||
response: | ||
body: | ||
string: '{"results":[{"id":"1","errors":[]},{"id":"2","errors":[]}]}' | ||
headers: | ||
Cache-Control: | ||
- max-age=0, private, must-revalidate | ||
Content-Type: | ||
- application/json; charset=utf-8 | ||
ETag: | ||
- W/"524357b5bfe8f3cf4539eab2daa660ff" | ||
Server: | ||
- Jetty(9.2.29.v20191105) | ||
Transfer-Encoding: | ||
- chunked | ||
X-Content-Type-Options: | ||
- nosniff | ||
X-Frame-Options: | ||
- SAMEORIGIN | ||
X-Request-Id: | ||
- 279c7794-35e5-47ad-a5e0-3228fd8e031d | ||
X-Runtime: | ||
- '0.147254' | ||
X-XSS-Protection: | ||
- 1; mode=block | ||
status: | ||
code: 200 | ||
message: OK | ||
version: 1 |
47 changes: 47 additions & 0 deletions
47
tests/apis/cassettes/test_documents/TestDocuments.test_index_documents_source_not_found.yaml
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,47 @@ | ||
interactions: | ||
- request: | ||
body: '[1, 2]' | ||
headers: | ||
Accept: | ||
- '*/*' | ||
Accept-Encoding: | ||
- gzip, deflate | ||
Authorization: | ||
- Bearer 32744aeb04f1269f57376347ee1d8f4e915e8273bfa9b2036aff4ef770bd2377 | ||
Connection: | ||
- keep-alive | ||
Content-Length: | ||
- '6' | ||
Content-Type: | ||
- application/json | ||
method: POST | ||
uri: http://localhost:8080/api/ws/v1/sources/bad-source-key/documents/bulk_create | ||
response: | ||
body: | ||
string: '' | ||
headers: | ||
Cache-Control: | ||
- no-cache | ||
Content-Security-Policy: | ||
- script-src 'nonce-e+nsspLfDiVaIGU5HixHxA==' 'strict-dynamic' 'self'; object-src | ||
'none'; base-uri 'none'; frame-ancestors 'self'; | ||
Content-Type: | ||
- text/html | ||
Server: | ||
- Jetty(9.2.29.v20191105) | ||
Transfer-Encoding: | ||
- chunked | ||
X-Content-Type-Options: | ||
- nosniff | ||
X-Frame-Options: | ||
- SAMEORIGIN | ||
X-Request-Id: | ||
- 81b28e5a-56c3-46e3-820a-8e6238361ca6 | ||
X-Runtime: | ||
- '0.036074' | ||
X-XSS-Protection: | ||
- 1; mode=block | ||
status: | ||
code: 404 | ||
message: Not Found | ||
version: 1 |
46 changes: 46 additions & 0 deletions
46
tests/apis/cassettes/test_permissions/TestPermissions.test_add_user_permissions.yaml
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,46 @@ | ||
interactions: | ||
- request: | ||
body: '{"permissions": ["permission1"]}' | ||
headers: | ||
Accept: | ||
- '*/*' | ||
Accept-Encoding: | ||
- gzip, deflate | ||
Authorization: | ||
- Bearer 32744aeb04f1269f57376347ee1d8f4e915e8273bfa9b2036aff4ef770bd2377 | ||
Connection: | ||
- keep-alive | ||
Content-Length: | ||
- '32' | ||
Content-Type: | ||
- application/json | ||
method: POST | ||
uri: http://localhost:8080/api/ws/v1/sources/5eebbb1e5e21d6c1e64f9578/permissions/enterprise_search/add | ||
response: | ||
body: | ||
string: '{"user":"enterprise_search","permissions":["permission1"]}' | ||
headers: | ||
Cache-Control: | ||
- max-age=0, private, must-revalidate | ||
Content-Type: | ||
- application/json; charset=utf-8 | ||
ETag: | ||
- W/"6cb0d74ff26d6f74253df3ee283a38dd" | ||
Server: | ||
- Jetty(9.2.29.v20191105) | ||
Transfer-Encoding: | ||
- chunked | ||
X-Content-Type-Options: | ||
- nosniff | ||
X-Frame-Options: | ||
- SAMEORIGIN | ||
X-Request-Id: | ||
- 6cee13b3-2f2c-4983-9b35-cbe1825b9043 | ||
X-Runtime: | ||
- '0.061162' | ||
X-XSS-Protection: | ||
- 1; mode=block | ||
status: | ||
code: 200 | ||
message: OK | ||
version: 1 |
42 changes: 42 additions & 0 deletions
42
tests/apis/cassettes/test_permissions/TestPermissions.test_get_user_permissions.yaml
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,42 @@ | ||
interactions: | ||
- request: | ||
body: null | ||
headers: | ||
Accept: | ||
- '*/*' | ||
Accept-Encoding: | ||
- gzip, deflate | ||
Authorization: | ||
- Bearer 32744aeb04f1269f57376347ee1d8f4e915e8273bfa9b2036aff4ef770bd2377 | ||
Connection: | ||
- keep-alive | ||
method: GET | ||
uri: http://localhost:8080/api/ws/v1/sources/5eebbb1e5e21d6c1e64f9578/permissions/enterprise_search | ||
response: | ||
body: | ||
string: '{"user":"enterprise_search","permissions":["permission1"]}' | ||
headers: | ||
Cache-Control: | ||
- max-age=0, private, must-revalidate | ||
Content-Type: | ||
- application/json; charset=utf-8 | ||
ETag: | ||
- W/"6cb0d74ff26d6f74253df3ee283a38dd" | ||
Server: | ||
- Jetty(9.2.29.v20191105) | ||
Transfer-Encoding: | ||
- chunked | ||
X-Content-Type-Options: | ||
- nosniff | ||
X-Frame-Options: | ||
- SAMEORIGIN | ||
X-Request-Id: | ||
- bd1e3517-4395-4399-980f-b8dcfd883491 | ||
X-Runtime: | ||
- '0.040057' | ||
X-XSS-Protection: | ||
- 1; mode=block | ||
status: | ||
code: 200 | ||
message: OK | ||
version: 1 |
42 changes: 42 additions & 0 deletions
42
tests/apis/cassettes/test_permissions/TestPermissions.test_list_all_permissions.yaml
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,42 @@ | ||
interactions: | ||
- request: | ||
body: null | ||
headers: | ||
Accept: | ||
- '*/*' | ||
Accept-Encoding: | ||
- gzip, deflate | ||
Authorization: | ||
- Bearer 32744aeb04f1269f57376347ee1d8f4e915e8273bfa9b2036aff4ef770bd2377 | ||
Connection: | ||
- keep-alive | ||
method: GET | ||
uri: http://localhost:8080/api/ws/v1/sources/5eebbb1e5e21d6c1e64f9578/permissions?page%5Bcurrent%5D=1&page%5Bsize%5D=25 | ||
response: | ||
body: | ||
string: '{"meta":{"page":{"current":1,"total_pages":1,"total_results":1,"size":25}},"results":[{"user":"enterprise_search","permissions":["permission1"]}]}' | ||
headers: | ||
Cache-Control: | ||
- max-age=0, private, must-revalidate | ||
Content-Type: | ||
- application/json; charset=utf-8 | ||
ETag: | ||
- W/"21372cc57fbf7b6f6d19643937e4eaaf" | ||
Server: | ||
- Jetty(9.2.29.v20191105) | ||
Transfer-Encoding: | ||
- chunked | ||
X-Content-Type-Options: | ||
- nosniff | ||
X-Frame-Options: | ||
- SAMEORIGIN | ||
X-Request-Id: | ||
- 7225d807-7a02-4322-a48a-6c05669c3eb6 | ||
X-Runtime: | ||
- '0.041343' | ||
X-XSS-Protection: | ||
- 1; mode=block | ||
status: | ||
code: 200 | ||
message: OK | ||
version: 1 |
Oops, something went wrong.