Skip to content

Commit

Permalink
Merge pull request #570 from Darsstar/bugfix/config_root
Browse files Browse the repository at this point in the history
Fix keyring.util.platform_.config_root on Windows
  • Loading branch information
jaraco committed May 23, 2022
2 parents 7cd5604 + 1054a53 commit 2135820
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
v23.5.1
-------

* 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)
15 changes: 15 additions & 0 deletions tests/util/test_platform.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import pytest

from keyring.util import platform_


@pytest.mark.skipif('platform.system() != "Linux"')
def test_platform_Linux():
assert platform_.config_root == platform_._config_root_Linux
assert platform_.data_root == platform_._data_root_Linux


@pytest.mark.skipif('platform.system() != "Windows"')
def test_platform_Windows():
assert platform_.config_root == platform_._config_root_Windows
assert platform_.data_root == platform_._data_root_Windows

0 comments on commit 2135820

Please sign in to comment.