Skip to content

Commit

Permalink
use os path for path count
Browse files Browse the repository at this point in the history
  • Loading branch information
KeynesYouDigIt committed Nov 23, 2024
1 parent 3434620 commit e44eab7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/test_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -832,12 +832,18 @@ def test_generate_subcatalogs_works_for_subcatalogs_with_same_ids(self) -> None:
assert len(result) == 6

catalog.normalize_hrefs("/")

for item in catalog.get_items(recursive=True):
item_parent = item.get_parent()
assert item_parent is not None
parent_href = item_parent.self_href
path_to_parent, _ = os.path.split(parent_href)
subcats = [el for el in path_to_parent.split("/") if el]
# subcats = [el for el in path_to_parent.split("/") if el]
subcats = list(
Path(path_to_parent).parts[1:]
) # Skip drive letter if present (Windows)

## D: creates failure for py3.13 on windows
assert len(subcats) == 2, f" for item '{item.id}'"

def test_map_items(self) -> None:
Expand Down

0 comments on commit e44eab7

Please sign in to comment.