aboutsummaryrefslogtreecommitdiff
path: root/lib/project/tests/test_install.py
diff options
context:
space:
mode:
authorhistoria <historiavg@proton.me>2026-09-11 17:41:33 -0400
committerhistoria <historiavg@proton.me>2026-09-11 17:41:33 -0400
commit077c82d9614328ff267632298da6c88009313337 (patch)
tree412f9e2d60c320e0c014eda45e76e36205b526ed /lib/project/tests/test_install.py
parent84dd2d068317998f6fb59400c534ef5be6b51b53 (diff)
downloadproducer-077c82d9614328ff267632298da6c88009313337.tar.gz
fix: consistently rename to producer
Diffstat (limited to 'lib/project/tests/test_install.py')
-rw-r--r--lib/project/tests/test_install.py38
1 files changed, 19 insertions, 19 deletions
diff --git a/lib/project/tests/test_install.py b/lib/project/tests/test_install.py
index f1dfcf2..a137cf1 100644
--- a/lib/project/tests/test_install.py
+++ b/lib/project/tests/test_install.py
@@ -7,7 +7,7 @@ import types
import pytest
-from voiceforge import setup
+from producer import setup
ROOT = Path(__file__).resolve().parents[3]
LAUNCHER = ROOT / "producer.sh"
@@ -16,7 +16,7 @@ LAUNCHER = ROOT / "producer.sh"
@pytest.fixture
def shell_env(tmp_path):
env = os.environ.copy()
- env.pop("VOICEFORGE_HOME", None)
+ env.pop("PRODUCER_HOME", None)
env.pop("XDG_DATA_HOME", None)
env["HOME"] = str(tmp_path / "home")
return env
@@ -25,33 +25,33 @@ def shell_env(tmp_path):
# --- data_dir resolution ---------------------------------------------------
def test_data_dir_defaults_and_precedence(tmp_path, monkeypatch):
- monkeypatch.delenv("VOICEFORGE_HOME", raising=False)
+ monkeypatch.delenv("PRODUCER_HOME", raising=False)
monkeypatch.delenv("XDG_DATA_HOME", raising=False)
monkeypatch.setenv("HOME", str(tmp_path))
- assert setup.data_dir() == tmp_path / ".local/share/voiceforge"
+ assert setup.data_dir() == tmp_path / ".local/share/producer"
monkeypatch.setenv("XDG_DATA_HOME", str(tmp_path / "xdg"))
- assert setup.data_dir() == tmp_path / "xdg/voiceforge"
- monkeypatch.setenv("VOICEFORGE_HOME", str(tmp_path / "prefix"))
+ assert setup.data_dir() == tmp_path / "xdg/producer"
+ monkeypatch.setenv("PRODUCER_HOME", str(tmp_path / "prefix"))
assert setup.data_dir() == tmp_path / "prefix"
-def test_relative_voiceforge_home_resolves_against_cwd(tmp_path, monkeypatch):
- monkeypatch.setenv("VOICEFORGE_HOME", "voiceforge-home")
+def test_relative_producer_home_resolves_against_cwd(tmp_path, monkeypatch):
+ monkeypatch.setenv("PRODUCER_HOME", "producer-home")
monkeypatch.chdir(tmp_path)
- assert setup.data_dir() == tmp_path / "voiceforge-home"
+ assert setup.data_dir() == tmp_path / "producer-home"
def test_relative_xdg_data_home_falls_back_to_home(tmp_path, monkeypatch):
- monkeypatch.delenv("VOICEFORGE_HOME", raising=False)
+ monkeypatch.delenv("PRODUCER_HOME", raising=False)
monkeypatch.setenv("HOME", str(tmp_path))
monkeypatch.setenv("XDG_DATA_HOME", "relative/path")
- assert setup.data_dir() == tmp_path / ".local/share/voiceforge"
+ assert setup.data_dir() == tmp_path / ".local/share/producer"
# --- contained tool environment --------------------------------------------
def test_tool_env_is_sanitized_and_contained(tmp_path, monkeypatch):
- monkeypatch.setenv("VOICEFORGE_HOME", str(tmp_path / "prefix"))
+ monkeypatch.setenv("PRODUCER_HOME", str(tmp_path / "prefix"))
monkeypatch.setenv("PYTHONPATH", "/host/site-packages")
monkeypatch.setenv("PYTHONHOME", "/host/python")
monkeypatch.setenv("VIRTUAL_ENV", "/host/venv")
@@ -89,21 +89,21 @@ def test_tool_env_is_sanitized_and_contained(tmp_path, monkeypatch):
def test_tool_env_tolerates_an_uncreatable_data_dir(monkeypatch):
- monkeypatch.setenv("VOICEFORGE_HOME", "/vf-prefix-unwritable")
+ monkeypatch.setenv("PRODUCER_HOME", "/vf-prefix-unwritable")
env = setup.tool_env()
assert env["PIP_CACHE_DIR"] == "/vf-prefix-unwritable/cache/pip"
assert "TMPDIR" not in env
def test_tool_env_leaves_process_environment_untouched(tmp_path, monkeypatch):
- monkeypatch.setenv("VOICEFORGE_HOME", str(tmp_path / "prefix"))
+ monkeypatch.setenv("PRODUCER_HOME", str(tmp_path / "prefix"))
monkeypatch.setenv("PYTHONPATH", "/host/site-packages")
setup.tool_env()
assert os.environ["PYTHONPATH"] == "/host/site-packages"
def test_ensure_uv_bootstraps_into_data_dir_with_contained_pip_cache(tmp_path, monkeypatch):
- monkeypatch.setenv("VOICEFORGE_HOME", str(tmp_path / "prefix"))
+ monkeypatch.setenv("PRODUCER_HOME", str(tmp_path / "prefix"))
monkeypatch.setattr(setup.shutil, "which", lambda name: None)
calls = []
uv_binary = tmp_path / "prefix/bootstrap/bin/uv"
@@ -130,7 +130,7 @@ def test_ensure_uv_bootstraps_into_data_dir_with_contained_pip_cache(tmp_path, m
def test_ensure_uv_reuses_contained_bootstrap(tmp_path, monkeypatch):
- monkeypatch.setenv("VOICEFORGE_HOME", str(tmp_path / "prefix"))
+ monkeypatch.setenv("PRODUCER_HOME", str(tmp_path / "prefix"))
uv_binary = tmp_path / "prefix/bootstrap/bin/uv"
uv_binary.parent.mkdir(parents=True)
uv_binary.write_text("#!/bin/sh\n")
@@ -140,7 +140,7 @@ def test_ensure_uv_reuses_contained_bootstrap(tmp_path, monkeypatch):
def test_ensure_uv_prefers_the_contained_bootstrap_over_a_host_uv(tmp_path, monkeypatch):
- monkeypatch.setenv("VOICEFORGE_HOME", str(tmp_path / "prefix"))
+ monkeypatch.setenv("PRODUCER_HOME", str(tmp_path / "prefix"))
uv_binary = tmp_path / "prefix/bootstrap/bin/uv"
uv_binary.parent.mkdir(parents=True)
uv_binary.write_text("#!/bin/sh\n")
@@ -150,7 +150,7 @@ def test_ensure_uv_prefers_the_contained_bootstrap_over_a_host_uv(tmp_path, monk
def test_ensure_uv_ignores_a_host_uv_without_required_capability(tmp_path, monkeypatch):
- monkeypatch.setenv("VOICEFORGE_HOME", str(tmp_path / "prefix"))
+ monkeypatch.setenv("PRODUCER_HOME", str(tmp_path / "prefix"))
monkeypatch.setattr(setup.shutil, "which", lambda name: "/host/bin/uv")
monkeypatch.setattr(setup, "_uv_supports_relocatable", lambda uv: False)
stages = []
@@ -169,7 +169,7 @@ def test_ensure_uv_ignores_a_host_uv_without_required_capability(tmp_path, monke
def test_ensure_uv_fails_when_bootstrap_does_not_produce_uv(tmp_path, monkeypatch):
- monkeypatch.setenv("VOICEFORGE_HOME", str(tmp_path / "prefix"))
+ monkeypatch.setenv("PRODUCER_HOME", str(tmp_path / "prefix"))
monkeypatch.setattr(setup.shutil, "which", lambda name: None)
monkeypatch.setattr(setup, "run_process", lambda *args, **kwargs: None)
with pytest.raises(RuntimeError, match="did not produce a usable uv"):