import pytest from src.jobs import normalize_target_space def test_normalize_target_space_with_slug(): assert normalize_target_space(username="alice", target_slug="my-space", run_id="run-123") == "alice/my-space" def test_normalize_target_space_rejects_other_namespace(): with pytest.raises(ValueError): normalize_target_space(username="alice", target_slug="bob/my-space", run_id="run-123") def test_normalize_target_space_accepts_own_namespace(): assert normalize_target_space(username="alice", target_slug="alice/my-space", run_id="run-123") == "alice/my-space"