50 lines
1.2 KiB
Python
50 lines
1.2 KiB
Python
from pathlib import Path
|
|
|
|
from acupedia_ops.local.bootstrap import build_local_bootstrap_args
|
|
from acupedia_ops.local.workspace import (
|
|
BootstrapDefaults,
|
|
LocalInfraConfig,
|
|
LocalWorkspace,
|
|
)
|
|
|
|
|
|
def test_content_bootstrap_args(tmp_path: Path) -> None:
|
|
content = tmp_path / "content"
|
|
content.mkdir()
|
|
config = content / "config.json"
|
|
config.write_text("{}", encoding="utf-8")
|
|
|
|
workspace = LocalWorkspace(
|
|
base_path=tmp_path,
|
|
root=tmp_path,
|
|
components={},
|
|
paths={"api": tmp_path / "api"},
|
|
infra=LocalInfraConfig(
|
|
compose_file=tmp_path / "compose.yml",
|
|
project_name="test",
|
|
),
|
|
bootstrap=BootstrapDefaults(
|
|
default_target="content",
|
|
content_config=config,
|
|
modules_root=content,
|
|
media_manifest=None,
|
|
media_root=None,
|
|
commerce_plans=None,
|
|
),
|
|
database_reset_command=(),
|
|
)
|
|
|
|
args = build_local_bootstrap_args(
|
|
workspace,
|
|
"content",
|
|
publish_content=True,
|
|
)
|
|
|
|
assert args == [
|
|
"--config",
|
|
str(config),
|
|
"--modules-root",
|
|
str(content),
|
|
"--publish-content",
|
|
]
|