Skip to content

Commit

Permalink
debug resmgr test failure
Browse files Browse the repository at this point in the history
  • Loading branch information
kba committed Jan 22, 2024
1 parent fcba83d commit 0c5fbd2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/ocrd/resource_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,13 @@ def __init__(self, userdir=None, xdg_config_home=None, xdg_data_home=None, skip_
self._xdg_data_home = xdg_data_home
self._xdg_config_home = xdg_config_home
self._userdir = userdir
# import os
# import traceback
# traceback.print_stack()
# print(os.environ['HOME'])
# print(self.xdg_config_home)
self.user_list = Path(self.xdg_config_home, 'ocrd', 'resources.yml')
print(self.user_list)

if not skip_init:
self.load_resource_list(Path(RESOURCE_LIST_FILENAME))
Expand Down
2 changes: 1 addition & 1 deletion tests/test_resource_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ def test_resources_manager_config_default(monkeypatch, tmp_path):

# act
mgr = OcrdResourceManager()
mgr._xdg_config_home = None

# assert
default_config_dir = os.path.join(os.environ['HOME'], '.config', 'ocrd')
f = Path(default_config_dir) / CONST_RESOURCE_YML
assert os.environ['HOME'] == str(tmp_path)
assert Path.home() == str(tmp_path)
assert f.exists()
assert f == mgr.user_list
assert mgr.add_to_user_database('ocrd-foo', f)
Expand Down

0 comments on commit 0c5fbd2

Please sign in to comment.