Skip to content

Commit 496dc20

Browse files
tbitcsoz-agent
andcommitted
fix(tests): backdate spec_version in test_upgrade_to_new_version
Now that 0.11.7 is installed, _scaffold_governed() creates projects at 0.11.7 already, so upgrade --spec-version 0.11.7 returns 'Already at spec version'. Explicitly write spec_version=0.11.6 before invoking the upgrade so the test exercises an actual version change. Co-Authored-By: Oz <oz-agent@warp.dev>
1 parent e562c8a commit 496dc20

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

tests/test_cli.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,15 @@ def test_upgrade_already_current(self, tmp_path: Path) -> None:
113113

114114
def test_upgrade_to_new_version(self, tmp_path: Path) -> None:
115115
target = _scaffold_governed(tmp_path)
116+
# Backdate spec_version so there is an actual upgrade to perform.
117+
# Without this the scaffold is already at __version__ and the
118+
# command would return "Already at spec version" instead.
119+
scaffold_yml = target / "scaffold.yml"
120+
with open(scaffold_yml) as fh:
121+
data = yaml.safe_load(fh)
122+
data["spec_version"] = "0.11.6"
123+
with open(scaffold_yml, "w") as fh:
124+
yaml.dump(data, fh, default_flow_style=False)
116125
runner = CliRunner()
117126
result = runner.invoke(
118127
main, ["upgrade", "--project-dir", str(target), "--spec-version", "0.11.7"]

0 commit comments

Comments
 (0)