mirror of
https://github.com/jeertmans/manim-slides.git
synced 2025-05-18 19:16:21 +08:00

* test: re-add opencv-python * chore(dev): move to Rye instead of PDM * try fix * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix: build backend * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix: string quotes? * small fixes * upgrade typing * fix(ci): rye install on Windows * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix(ci): typos * fix * fix(ci): actually use right python version * fix(deps): manimgl * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix docs * another fix * cleanup * make sure to use trusted publisher * chore(docs): remove PDM --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
23 lines
584 B
Python
23 lines
584 B
Python
from pathlib import Path
|
|
|
|
from manim_slides.utils import merge_basenames
|
|
|
|
|
|
def test_merge_basenames(paths: list[Path]) -> None:
|
|
path = merge_basenames(paths)
|
|
assert path.suffix == paths[0].suffix
|
|
assert path.parent == paths[0].parent
|
|
|
|
|
|
def test_merge_basenames_same_with_different_parent_directories(
|
|
paths: list[Path],
|
|
) -> None:
|
|
d1 = Path("a/b/c")
|
|
d2 = Path("d/e/f")
|
|
p1 = d1 / "one.txt"
|
|
p2 = d1 / "a/b/c/two.txt"
|
|
p3 = d2 / "d/e/f/one.txt"
|
|
p4 = d2 / "d/e/f/two.txt"
|
|
|
|
assert merge_basenames([p1, p2]).name == merge_basenames([p3, p4]).name
|