Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mar10 committed Nov 10, 2021
1 parent fab4344 commit 60c6c0e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
3 changes: 1 addition & 2 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ PyYAML = "*" # "~=5.1"
json5 = "*"

[requires]
# Build with Python 3.8 [issue #216](https://github.com/mar10/wsgidav/issues/216)
python_version = "3.8"
python_version = "3.9"

[pipenv]
# allow_prereleases = true
2 changes: 0 additions & 2 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
-r requirements.txt

cheroot~=8.5
# Installed by PS script from vendored wheel (see release_wsgidav.ps1):
#cx_Freeze
Paste~=2.0
# Black is beta and therefore requires --pre flag for installation unless we give the exact number
black~=20.8b1
Expand Down
7 changes: 3 additions & 4 deletions tests/test_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ def testGet(self):

res = requests.get(self.url + "?davmount", auth=self.auth)
assert res.status_code == 200
# dir_browser.davmount option is not set, so we don't expect it:
assert res.headers["Content-Type"] == "text/html"
# assert '<dm:mount xmlns:dm="http://purl.org/NET/webdav/mount">' in res.text
# assert res.headers["Content-Type"] == "application/davmount+xml"
# dir_browser.davmount option is true by default:
assert '<dm:mount xmlns:dm="http://purl.org/NET/webdav/mount">' in res.text
assert res.headers["Content-Type"] == "application/davmount+xml"
6 changes: 4 additions & 2 deletions wsgidav/dir_browser/_dir_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def _get_context(self, environ, dav_res):

# TODO: WebDAV URLs only on Windows?
# TODO: WebDAV URLs only on HTTPS?
is_windows = "Windows NT " in environ.get("HTTP_USER_AGENT", "")
# is_windows = "Windows NT " in environ.get("HTTP_USER_AGENT", "")

context = {
"htdocs": (self.config.get("mount_path") or "") + ASSET_SHARE,
Expand Down Expand Up @@ -216,7 +216,9 @@ def _get_context(self, environ, dav_res):
ofe_prefix = "ms-{}:ofe|u|".format(ms_office_type)
a_classes.append("msoffice")
if libre_office_support:
add_link_html.append(f"<a class='edit2' title='Edit with Libre Office' href='vnd.libreoffice.command:ofv|u|{href}'>Edit</a>")
add_link_html.append(
f"<a class='edit2' title='Edit with Libre Office' href='vnd.libreoffice.command:ofv|u|{href}'>Edit</a>"
)
# ofe_prefix_2 = "vnd.libreoffice.command:ofv|u|"
# a_classes.append("msoffice")
elif libre_office_support:
Expand Down

0 comments on commit 60c6c0e

Please sign in to comment.