-
Notifications
You must be signed in to change notification settings - Fork 308
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
address deprecation of werkzeug.urls.url_parse (#1144)
* chore: delete __unicode__ methods * fix: disuse deprecated functions from werkzeug.urls * fix: disuse deprecated werkzeug.urls functions * fix: do not override user-specified warnings filter * fix: pin werkzeug<2.4, ignore deprecation warnings in tests
- Loading branch information
Showing
11 changed files
with
209 additions
and
37 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
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
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 |
---|---|---|
@@ -1,3 +1,50 @@ | ||
import inspect | ||
|
||
import pytest | ||
|
||
from lektor.environment.config import Config | ||
|
||
|
||
def test_custom_attachment_types(env): | ||
attachment_types = env.load_config().values["ATTACHMENT_TYPES"] | ||
assert attachment_types[".foo"] == "text" | ||
|
||
|
||
@pytest.fixture(scope="function") | ||
def config(tmp_path, project_url): | ||
projectfile = tmp_path / "scratch.lektorproject" | ||
projectfile.write_text( | ||
inspect.cleandoc( | ||
f""" | ||
[project] | ||
url = {project_url} | ||
""" | ||
) | ||
) | ||
return Config(projectfile) | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"project_url, expected", | ||
[ | ||
("", None), | ||
("/path/", None), | ||
("https://example.org", "https://example.org/"), | ||
], | ||
) | ||
def test_base_url(config, expected): | ||
assert config.base_url == expected | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"project_url, expected", | ||
[ | ||
("", "/"), | ||
("/path", "/path/"), | ||
("/path/", "/path/"), | ||
("https://example.org", "/"), | ||
("https://example.org/pth", "/pth/"), | ||
], | ||
) | ||
def test_base_path(config, expected): | ||
assert config.base_path == expected |
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
Oops, something went wrong.