Skip to content

Commit

Permalink
[cdd/tests/test_shared/test_pkg_utils.py] test_get_python_lib fix f…
Browse files Browse the repository at this point in the history
…or windows?
  • Loading branch information
SamuelMarks committed Mar 16, 2024
1 parent e92a2d9 commit 4608569
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions cdd/tests/test_shared/test_pkg_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from unittest import TestCase

from cdd.shared.pkg_utils import get_python_lib, relative_filename
from cdd.shared.pure_utils import rpartial, pp
from cdd.shared.pure_utils import rpartial
from cdd.tests.utils_for_tests import unittest_main


Expand All @@ -22,28 +22,14 @@ def test_get_python_lib(self) -> None:
"""Tests that `get_python_lib` works"""
python_lib: str = get_python_lib()
site_packages: str = getsitepackages()[0]
two_dirs_above: str = path.dirname(path.dirname(site_packages))
pp(
{
"python_lib": python_lib,
"two_dirs_above": two_dirs_above,
"site_packages": site_packages,
'path.join(two_dir_above, "Lib", "site-packages")': path.join(
two_dirs_above, "Lib", "site-packages"
),
'path.join(two_dir_above, "python3", "dist-packages")': path.join(
two_dirs_above, "python3", "dist-packages"
),
}
)
site_packages: str = next(
filter(
rpartial(eq, python_lib),
(
lambda two_dir_above: (
site_packages,
two_dir_above,
path.join(two_dir_above, "Lib", "site-packages"),
path.join(site_packages, "Lib", "site-packages"),
path.join(two_dir_above, "python3", "dist-packages"),
)
)(path.dirname(path.dirname(site_packages))),
Expand Down

0 comments on commit 4608569

Please sign in to comment.