Authored-By: OpenAI (GPT-5) <noreply@openai.com>
This commit is contained in:
+17
-10
@@ -559,15 +559,20 @@ class PublishingTests(unittest.TestCase):
|
|||||||
second = deploy.previous_route_contracts(app_dir)
|
second = deploy.previous_route_contracts(app_dir)
|
||||||
self.assertEqual(first, second)
|
self.assertEqual(first, second)
|
||||||
|
|
||||||
def test_removed_artifact_keeps_bucket_access_history(self):
|
def test_protected_split_bucket_survives_absence_and_blocks_legacy(self):
|
||||||
raw = fixture("split-site.yaml")
|
raw = fixture("split-site.yaml")
|
||||||
raw["artifacts"] = [item for item in raw["artifacts"] if item["name"] == "portal"]
|
raw["artifacts"] = [
|
||||||
raw["routes"] = [item for item in raw["routes"] if item["artifact"] == "portal"]
|
item for item in raw["artifacts"] if item["name"] == "distributions"
|
||||||
|
]
|
||||||
|
raw["routes"] = [
|
||||||
|
item for item in raw["routes"] if item["artifact"] == "distributions"
|
||||||
|
]
|
||||||
|
raw["routes"][0]["path"] = "/"
|
||||||
cfg = normalize_site_config(raw, "baseline.fritzlab.net")
|
cfg = normalize_site_config(raw, "baseline.fritzlab.net")
|
||||||
previous = {
|
previous = {
|
||||||
"baseline-dist": {
|
"baseline.fritzlab.net": {
|
||||||
"path": "/dist", "access": "protected", "artifact": "distributions",
|
"path": "/", "access": "protected", "artifact": "portal",
|
||||||
"immutable_paths": ["dist/releases"],
|
"immutable_paths": [],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
with tempfile.TemporaryDirectory() as tmp:
|
with tempfile.TemporaryDirectory() as tmp:
|
||||||
@@ -576,12 +581,14 @@ class PublishingTests(unittest.TestCase):
|
|||||||
"baseline.fritzlab.net", ROOT, app_dir, app_dir / "manifests", cfg, previous,
|
"baseline.fritzlab.net", ROOT, app_dir, app_dir / "manifests", cfg, previous,
|
||||||
)
|
)
|
||||||
retained = deploy.previous_route_contracts(app_dir)
|
retained = deploy.previous_route_contracts(app_dir)
|
||||||
self.assertEqual(previous["baseline-dist"], retained["baseline-dist"])
|
self.assertEqual(
|
||||||
readded = normalize_site_config(
|
previous["baseline.fritzlab.net"], retained["baseline.fritzlab.net"],
|
||||||
fixture("split-site.yaml"), "baseline.fritzlab.net",
|
)
|
||||||
|
legacy = normalize_site_config(
|
||||||
|
fixture("legacy-site.yaml"), "baseline.fritzlab.net",
|
||||||
)
|
)
|
||||||
with self.assertRaisesRegex(RuntimeError, "cannot become public while reusing protected"):
|
with self.assertRaisesRegex(RuntimeError, "cannot become public while reusing protected"):
|
||||||
deploy.validate_route_migrations(readded, retained)
|
deploy.validate_route_migrations(legacy, retained)
|
||||||
|
|
||||||
def test_malformed_persistent_history_fails_closed(self):
|
def test_malformed_persistent_history_fails_closed(self):
|
||||||
with tempfile.TemporaryDirectory() as tmp:
|
with tempfile.TemporaryDirectory() as tmp:
|
||||||
|
|||||||
Reference in New Issue
Block a user