from pathlib import Path


def test_source_deploy_syncs_versioned_ivr_assets_into_runtime_data_dir():
    root = Path(__file__).resolve().parents[1]
    script = (root / "scripts" / "deploy_gitlab.sh").read_text(encoding="utf-8")

    assert '.data_local/generated_ivr_yandex/ivr' in script
    assert '.asterisk_assets/ivr' in script
    assert 'rsync -a --delete \\' in script


def test_registry_deploy_syncs_asterisk_assets_and_ivr_wavs():
    root = Path(__file__).resolve().parents[1]
    ci = (root / ".gitlab-ci.yml").read_text(encoding="utf-8")

    assert "$DEPLOY_PATH/.asterisk_assets/ivr" in ci
    assert ".asterisk_assets/ivr/" in ci
    assert "$DEPLOY_PATH/.data_local/generated_ivr_yandex/ivr/" in ci
