28 lines
804 B
Python
28 lines
804 B
Python
from __future__ import annotations
|
|
|
|
import sys
|
|
import unittest
|
|
from pathlib import Path
|
|
|
|
sys.path.insert(0, str(Path(__file__).resolve().parents[3]))
|
|
|
|
from backend.app.services.move_task_service import MoveTaskService
|
|
|
|
|
|
class MoveTaskServiceTest(unittest.TestCase):
|
|
def test_is_nested_destination_true_for_child_path(self) -> None:
|
|
source = Path("/tmp/source")
|
|
destination = source / "child" / "target"
|
|
|
|
self.assertTrue(MoveTaskService._is_nested_destination(source, destination))
|
|
|
|
def test_is_nested_destination_false_for_sibling_path(self) -> None:
|
|
source = Path("/tmp/source")
|
|
destination = Path("/tmp/other/target")
|
|
|
|
self.assertFalse(MoveTaskService._is_nested_destination(source, destination))
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|