Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tw4l committed Feb 13, 2024
1 parent 6cf0626 commit 12eaa34
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/config_test_access.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ collections:
acl_paths:
- ./sample_archive/access/pywb.aclj

pywb-wildcard-surt:
index_paths: ./sample_archive/cdx/
archive_paths: ./sample_archive/warcs/
default_access: block
acl_paths:
- ./sample_archive/access/allow_all.aclj




8 changes: 8 additions & 0 deletions tests/test_acl.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,13 @@ def test_allowed_different_coll_acl_dir(self):

assert '"http://httpbin.org/anything/resource.json"' in resp.text

def test_allow_all_acl_user_specific(self):
resp = self.query('http://example.com', coll='pywb-wildcard-surt')
assert len(resp.text.splitlines()) == 0

resp = self.testapp.get('/pywb-wildcard-surt/mp_/http://example.com', headers={"X-Pywb-Acl-User": "staff"}, status=200)





0 comments on commit 12eaa34

Please sign in to comment.