I maintain this lib as an RPM package in Fedora Linux and when I try to build it on non-mainstream architectures, some tests fail.
All tests should pass.
Tests Output
======================================= FAILURES ========================================
__________________________ test_get_path_oob_move_nested[True] __________________________
fid_manager = <jupyter_server_fileid.manager.LocalFileIdManager object at 0x3ff82368250>
old_path = 'old_path', new_path = 'new_path', stub_stat_crtime = True
fs_helpers = <jupyter_server_fileid.pytest_plugin.fs_helpers..FsHelpers object at 0x3ff8254c050>
@pytest.mark.parametrize("stub_stat_crtime", [True, False], indirect=["stub_stat_crtime"])
def test_get_path_oob_move_nested(fid_manager, old_path, new_path, stub_stat_crtime, fs_helpers):
old_test_path = "test_path"
new_test_path = os.path.join(new_path, "test_path")
fs_helpers.touch(old_test_path)
fid_manager.index(old_path)
id = fid_manager.index(old_test_path)
fs_helpers.move(old_path, new_path)
fs_helpers.move(old_test_path, new_test_path)
assert fid_manager.get_path(id) == normalize_path(fid_manager, new_test_path)
E AssertionError: assert None == 'new_path/test_path'
E + where None = <bound method LocalFileIdManager.get_path of <jupyter_server_fileid.manager.LocalFileIdManager object at 0x3ff82368250>>('c02d1ffa-d33f-43ad-8b2c-36017ef35b39')
E + where <bound method LocalFileIdManager.get_path of <jupyter_server_fileid.manager.LocalFileIdManager object at 0x3ff82368250>> = <jupyter_server_fileid.manager.LocalFileIdManager object at 0x3ff82368250>.get_path
E + and 'new_path/test_path' = normalize_path(<jupyter_server_fileid.manager.LocalFileIdManager object at 0x3ff82368250>, 'new_path/test_path')
tests/test_manager.py:429: AssertionError
_________________________ test_get_path_oob_move_nested[False] __________________________
fid_manager = <jupyter_server_fileid.manager.LocalFileIdManager object at 0x3ff8236af90>
old_path = 'old_path', new_path = 'new_path', stub_stat_crtime = False
fs_helpers = <jupyter_server_fileid.pytest_plugin.fs_helpers..FsHelpers object at 0x3ff8236a0d0>
@pytest.mark.parametrize("stub_stat_crtime", [True, False], indirect=["stub_stat_crtime"])
def test_get_path_oob_move_nested(fid_manager, old_path, new_path, stub_stat_crtime, fs_helpers):
old_test_path = "test_path"
new_test_path = os.path.join(new_path, "test_path")
fs_helpers.touch(old_test_path)
fid_manager.index(old_path)
id = fid_manager.index(old_test_path)
fs_helpers.move(old_path, new_path)
fs_helpers.move(old_test_path, new_test_path)
assert fid_manager.get_path(id) == normalize_path(fid_manager, new_test_path)
E AssertionError: assert None == 'new_path/test_path'
E + where None = <bound method LocalFileIdManager.get_path of <jupyter_server_fileid.manager.LocalFileIdManager object at 0x3ff8236af90>>('08b7e8c1-3916-48f3-8770-43bc9ac076fe')
E + where <bound method LocalFileIdManager.get_path of <jupyter_server_fileid.manager.LocalFileIdManager object at 0x3ff8236af90>> = <jupyter_server_fileid.manager.LocalFileIdManager object at 0x3ff8236af90>.get_path
E + and 'new_path/test_path' = normalize_path(<jupyter_server_fileid.manager.LocalFileIdManager object at 0x3ff8236af90>, 'new_path/test_path')
tests/test_manager.py:429: AssertionError
______________________ test_get_path_oob_move_deeply_nested[True] _______________________
fid_manager = <jupyter_server_fileid.manager.LocalFileIdManager object at 0x3ff82343ad0>
old_path = 'old_path', new_path = 'new_path', old_path_child = 'old_path/child'
new_path_child = 'new_path/child', stub_stat_crtime = True
fs_helpers = <jupyter_server_fileid.pytest_plugin.fs_helpers..FsHelpers object at 0x3ff82343390>
@pytest.mark.parametrize("stub_stat_crtime", [True, False], indirect=["stub_stat_crtime"])
def test_get_path_oob_move_deeply_nested(
fid_manager, old_path, new_path, old_path_child, new_path_child, stub_stat_crtime, fs_helpers
):
old_test_path = "test_path"
new_test_path = os.path.join(new_path_child, "test_path")
fs_helpers.touch(old_test_path)
fid_manager.index(old_path)
fid_manager.index(old_path_child)
id = fid_manager.index(old_test_path)
fs_helpers.move(old_path, new_path)
fs_helpers.move(old_test_path, new_test_path)
assert fid_manager.get_path(id) == normalize_path(fid_manager, new_test_path)
E AssertionError: assert None == 'new_path/child/test_path'
E + where None = <bound method LocalFileIdManager.get_path of <jupyter_server_fileid.manager.LocalFileIdManager object at 0x3ff82343ad0>>('2d524c33-c4fc-44d9-ad64-425e7f44d044')
E + where <bound method LocalFileIdManager.get_path of <jupyter_server_fileid.manager.LocalFileIdManager object at 0x3ff82343ad0>> = <jupyter_server_fileid.manager.LocalFileIdManager object at 0x3ff82343ad0>.get_path
E + and 'new_path/child/test_path' = normalize_path(<jupyter_server_fileid.manager.LocalFileIdManager object at 0x3ff82343ad0>, 'new_path/child/test_path')
tests/test_manager.py:448: AssertionError
______________________ test_get_path_oob_move_deeply_nested[False] ______________________
fid_manager = <jupyter_server_fileid.manager.LocalFileIdManager object at 0x3ff8232a610>
old_path = 'old_path', new_path = 'new_path', old_path_child = 'old_path/child'
new_path_child = 'new_path/child', stub_stat_crtime = False
fs_helpers = <jupyter_server_fileid.pytest_plugin.fs_helpers..FsHelpers object at 0x3ff82328890>
@pytest.mark.parametrize("stub_stat_crtime", [True, False], indirect=["stub_stat_crtime"])
def test_get_path_oob_move_deeply_nested(
fid_manager, old_path, new_path, old_path_child, new_path_child, stub_stat_crtime, fs_helpers
):
old_test_path = "test_path"
new_test_path = os.path.join(new_path_child, "test_path")
fs_helpers.touch(old_test_path)
fid_manager.index(old_path)
fid_manager.index(old_path_child)
id = fid_manager.index(old_test_path)
fs_helpers.move(old_path, new_path)
fs_helpers.move(old_test_path, new_test_path)
assert fid_manager.get_path(id) == normalize_path(fid_manager, new_test_path)
E AssertionError: assert None == 'new_path/child/test_path'
E + where None = <bound method LocalFileIdManager.get_path of <jupyter_server_fileid.manager.LocalFileIdManager object at 0x3ff8232a610>>('e595adb2-0483-4863-89b0-d59885318541')
E + where <bound method LocalFileIdManager.get_path of <jupyter_server_fileid.manager.LocalFileIdManager object at 0x3ff8232a610>> = <jupyter_server_fileid.manager.LocalFileIdManager object at 0x3ff8232a610>.get_path
E + and 'new_path/child/test_path' = normalize_path(<jupyter_server_fileid.manager.LocalFileIdManager object at 0x3ff8232a610>, 'new_path/child/test_path')
tests/test_manager.py:448: AssertionError
=================================== warnings summary ====================================
venv/lib64/python3.11/site-packages/jupyter_server/services/contents/filemanager.py:14
/root/jupyter_server_fileid/venv/lib64/python3.11/site-packages/jupyter_server/services/contents/filemanager.py:14: DeprecationWarning: Jupyter is migrating its paths to use standard platformdirs
given by the platformdirs library. To remove this warning and
see the appropriate new directories, set the environment variable
JUPYTER_PLATFORM_DIRS=1
and then run jupyter --paths
.
The use of platformdirs will be the default in jupyter_core
v6
from jupyter_core.paths import exists, is_file_hidden, is_hidden
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================================= slowest 10 durations ==================================
(10 durations < 0.005s hidden. Use -vv to show these durations.)
================================ short test summary info ================================
SKIPPED [1] tests/test_manager.py:215: Requires crtime support.
SKIPPED [1] tests/test_manager.py:228: Requires crtime support.
FAILED tests/test_manager.py::test_get_path_oob_move_nested[True] - AssertionError: assert None == 'new_path/test_path'
FAILED tests/test_manager.py::test_get_path_oob_move_nested[False] - AssertionError: assert None == 'new_path/test_path'
FAILED tests/test_manager.py::test_get_path_oob_move_deeply_nested[True] - AssertionError: assert None == 'new_path/child/test_path'
FAILED tests/test_manager.py::test_get_path_oob_move_deeply_nested[False] - AssertionError: assert None == 'new_path/child/test_path'
================== 4 failed, 47 passed, 2 skipped, 1 warning in 0.41s ===================