mirror of
https://github.com/Kozea/Radicale.git
synced 2025-06-26 16:45:52 +00:00
Test custom header
This commit is contained in:
parent
88d558f9fa
commit
b25a601e28
1 changed files with 11 additions and 0 deletions
|
@ -836,6 +836,17 @@ class BaseRequestsMixIn:
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def test_custom_headers(self):
|
||||||
|
if not self.configuration.has_section("headers"):
|
||||||
|
self.configuration.add_section("headers")
|
||||||
|
self.configuration.set("headers", "test", "123")
|
||||||
|
# Test if header is set on success
|
||||||
|
status, headers, answer = self.request("GET", "/")
|
||||||
|
assert headers.get("test") == "123"
|
||||||
|
# Test if header is set on failure
|
||||||
|
status, headers, answer = self.request("GET", "/.well-known/does not exist")
|
||||||
|
assert headers.get("test") == "123"
|
||||||
|
|
||||||
|
|
||||||
class BaseFileSystemTest(BaseTest):
|
class BaseFileSystemTest(BaseTest):
|
||||||
"""Base class for filesystem backend tests."""
|
"""Base class for filesystem backend tests."""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue