Tests: the feed tests know that unknown platforms are skipped, and the install.sh release-path test gives a Linux ARM64 host its own feed file
This commit is contained in:
1 parent
58f244ab1e
commit
09c18d3e98
2 files changed
+9
-2
No files matched your search
@@ -165,6 +165,9 @@ class Feed(unittest.TestCase):
|
||||
bad = work / "bad" # a Windows pack that is not a zip cannot be installed by install.ps1: left out of the manifest
|
||||
feed_tool.build_feed(bad, key=key, sequence=1, control_dir=self._windows_tar_pack(folder, work))
|
||||
self.assertFalse((bad / "install-manifest.txt").exists())
|
||||
if PLAT == "linux-aarch64": # the Linux ARM64 Terminal reads its own feed file (same bytes here)
|
||||
for suffix in ("", ".sig"):
|
||||
shutil.copy2(release / ("strata-feed.json" + suffix), release / ("strata-feed-linux-aarch64.json" + suffix))
|
||||
shutil.copy2(ROOT / "packaging" / "install.sh", release / "install.sh") # uploaded unchanged
|
||||
shutil.copy2(work / "keys" / "feed-key.pub.json", release / "test-trust.json")
|
||||
if os.name == "nt" or not (shutil.which("sh") and shutil.which("curl") and shutil.which("tar")):
|
||||
|
||||
@@ -143,11 +143,15 @@ class FeedChecks(unittest.TestCase):
|
||||
self.load(*signed(document(channel="beta"), self.key), channel="stable")
|
||||
|
||||
def test_malformed_entries_are_errors_not_defaults(self):
|
||||
for change in ({"sha256": "nothex"}, {"size": 0}, {"format": "rar"}, {"platform": "plan9"}, {"backend": "tpu"},
|
||||
{"version": "latest"}, {"archs": []}, {"manifest_sha256": None}, {"size": True}):
|
||||
for change in ({"sha256": "nothex"}, {"size": 0}, {"version": "latest"}, {"archs": []}, {"manifest_sha256": None}, {"size": True}):
|
||||
with self.subTest(change=change):
|
||||
with self.assertRaises(feedmod.FeedError):
|
||||
self.load(*signed(document(engine={"packages": [entry(**change)]}), self.key))
|
||||
for change in ({"format": "rar"}, {"platform": "plan9"}, {"backend": "tpu"}): # a kind this Control does not know: left out with a line, not an error (0.1.53)
|
||||
with self.subTest(unknown=change):
|
||||
feed = self.load(*signed(document(engine={"packages": [entry(), entry(**change, url="other.tar.gz")]}), self.key))
|
||||
self.assertEqual(len(feed.engine), 1)
|
||||
self.assertEqual(len(feed.skipped), 1)
|
||||
with self.assertRaisesRegex(feedmod.FeedError, "twice"):
|
||||
self.load(*signed(document(engine={"packages": [entry(), entry()]}), self.key))
|
||||
with self.assertRaises(feedmod.FeedError):
|
||||
|
||||
Reference in new issue
Block a user