Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix keyring.util.platform_.config_root on Windows #570

Merged
merged 6 commits into from
May 23, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
v????
jaraco marked this conversation as resolved.
Show resolved Hide resolved
-------

* The correct config root is now used on Windows.

v23.5.0
-------

Expand Down
2 changes: 1 addition & 1 deletion keyring/util/platform_.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ def _config_root_Linux():

# by default, use Unix convention
data_root = globals().get('_data_root_' + platform.system(), _data_root_Linux)
config_root = globals().get('_config_root' + platform.system(), _config_root_Linux)
config_root = globals().get('_config_root_' + platform.system(), _config_root_Linux)
28 changes: 28 additions & 0 deletions tests/util/test_platform.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import platform

from keyring.util.platform_ import (
config_root,
data_root,
_config_root_Linux,
_config_root_Windows,
_data_root_Linux,
_data_root_Windows,
)


def test_platform_Linux():
# rely on the Github Actions workflow to run this on different platforms
if platform.system() != "Linux":
return
Darsstar marked this conversation as resolved.
Show resolved Hide resolved

assert config_root == _config_root_Linux
assert data_root == _data_root_Linux


def test_platform_Windows():
# rely on the Github Actions workflow to run this on different platforms
if platform.system() != "Windows":
return

assert config_root == _config_root_Windows
assert data_root == _data_root_Windows