Skip to content

Commit

Permalink
Fix the calculation of directory levels inside the test.
Browse files Browse the repository at this point in the history
(cherry picked from commit 1d7573feb456de90239bd12a48759a817e38afc1)
  • Loading branch information
alexandervsokol committed Oct 22, 2024
1 parent 00cdab3 commit 7a3994c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/cl/runtime/settings/test_project_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@ def test_project_settings():
"""Test ProjectSettings class."""

# Relative to the location of this test module
two_level_root_dir = os.path.normpath(Path(__file__).parents[6])
one_level_root_dir = os.path.normpath(Path(__file__).parents[5])
two_level_root_dir = os.path.normpath(Path(__file__).parents[5])
one_level_root_dir = os.path.normpath(Path(__file__).parents[4])

# Create settings
project_settings = ProjectSettings.instance()

# Check project root
if ProjectSettings.project_levels == 1:
assert project_settings.project_root == two_level_root_dir
if project_settings.project_levels == 1:
assert project_settings.project_root == one_level_root_dir
assert project_settings.get_package_root("cl.runtime") == project_settings.project_root
assert project_settings.get_source_root("cl.runtime") == os.path.normpath(
os.path.join(project_settings.project_root, "cl", "runtime")
)
elif project_settings.project_levels == 2:
assert project_settings.project_root == one_level_root_dir
assert project_settings.project_root == two_level_root_dir
assert project_settings.get_package_root("cl.runtime") == os.path.normpath(
os.path.join(project_settings.project_root, "runtime")
)
Expand Down

0 comments on commit 7a3994c

Please sign in to comment.