Skip to content

Commit 425af86

Browse files
committed
Make migration contract tests independent of checkout names
Use the declared 1.10 target instead of inferring it from the local PA110 folder. Add a relocation regression and keep all typed-state and negative-control assertions.
1 parent 79fb164 commit 425af86

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

‎CHANGELOG.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ basePower 2.4.4.110021
1212
- Route Forge fluid capability calls through each machine's fluid handler, so stills fill their input tank and tank restrictions are respected.
1313
- Keep current OreSpawn global and saved-world profiles readable after a full restart, without resetting generation choices or accepting unknown future schemas.
1414
- Add the basePower project logo and updated installation, migration and CurseForge descriptions.
15+
- Run the migration-contract checks in clean checkouts and CI without depending on local folder names.
1516

1617
Earlier unreleased Advantage fixes, retained in basePower
1718

‎test-rig/migration/test_steam_control_audit.py‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44
import contextlib
55
from copy import deepcopy
66
import gzip
7+
import importlib.util
78
import io
89
import json
910
from pathlib import Path
11+
import shutil
1012
import tempfile
1113
import unittest
1214
from unittest.mock import patch
@@ -15,7 +17,8 @@
1517
import steam_control_audit as audit
1618

1719

18-
LINE = Path(__file__).resolve().parents[3].name[2:]
20+
# This branch tests 1.10; checkout directory names are not version metadata.
21+
LINE = "110"
1922

2023

2124
def snapshot(position, block, data=None):
@@ -123,6 +126,16 @@ def change_tile(row, line, **changes):
123126

124127

125128
class SteamControlAuditTests(unittest.TestCase):
129+
def test_fixture_version_survives_a_differently_named_checkout(self):
130+
with tempfile.TemporaryDirectory(prefix="advantage-checkout-") as temporary:
131+
relocated = Path(temporary) / "A Different Repository Name" / "test_steam_control_audit.py"
132+
relocated.parent.mkdir()
133+
shutil.copyfile(__file__, relocated)
134+
spec = importlib.util.spec_from_file_location("relocated_steam_contract", relocated)
135+
module = importlib.util.module_from_spec(spec)
136+
spec.loader.exec_module(module)
137+
self.assertEqual("110", module.LINE)
138+
126139
def test_namespace_is_exact_and_version_specific(self):
127140
self.assertEqual("basesteam:steam_crusher", audit.steam_block("steam_crusher", "110"))
128141
self.assertEqual("steamadvantage:steam_crusher", audit.steam_block("steam_crusher", "112"))

0 commit comments

Comments
 (0)