mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-04-25 15:57:18 +00:00
25 lines
669 B
Python
25 lines
669 B
Python
from pathlib import Path
|
|
from pytest_mock import MockerFixture
|
|
from unittest import mock
|
|
|
|
from ahriman.models.repository_paths import RepositoryPaths
|
|
|
|
|
|
def test_create_tree(repository_paths: RepositoryPaths, mocker: MockerFixture) -> None:
|
|
"""
|
|
must create whole tree
|
|
"""
|
|
paths = {
|
|
prop
|
|
for prop in dir(repository_paths)
|
|
if not prop.startswith("_") and prop not in ("architecture", "create_tree", "root")
|
|
}
|
|
mocker.patch("pathlib.Path.mkdir")
|
|
|
|
repository_paths.create_tree()
|
|
Path.mkdir.assert_has_calls(
|
|
[
|
|
mock.call(mode=0o755, parents=True, exist_ok=True)
|
|
for _ in paths
|
|
])
|