-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
User-Agent should be possible to modify - see also #385
- Loading branch information
Showing
3 changed files
with
13 additions
and
9 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 |
---|---|---|
|
@@ -279,9 +279,14 @@ def testRequestCustomHeaders(self, mocked): | |
mocked().status_code = 200 | ||
mocked().headers = {} | ||
cal_url = "http://me:[email protected]øøh.example:80/" | ||
client = DAVClient(url=cal_url, headers={"X-NC-CalDAV-Webcal-Caching": "On"}) | ||
client = DAVClient( | ||
url=cal_url, | ||
headers={"X-NC-CalDAV-Webcal-Caching": "On", "User-Agent": "MyCaldavApp"}, | ||
) | ||
assert client.headers["Content-Type"] == "text/xml" | ||
assert client.headers["X-NC-CalDAV-Webcal-Caching"] == "On" | ||
## User-Agent would be overwritten by some boring default in earlier versions | ||
assert client.headers["User-Agent"] == "MyCaldavApp" | ||
|
||
@mock.patch("caldav.davclient.requests.Session.request") | ||
def testEmptyXMLNoContentLength(self, mocked): | ||
|