Support optional CLI and MCP in Windows source archives
This commit is contained in:
1 parent
4e277a107f
commit
2be6b3d2b4
4 files changed
+72
-5
No files matched your search
@@ -30,6 +30,24 @@ def inventory(resources):
|
||||
|
||||
|
||||
class PackageTests(unittest.TestCase):
|
||||
def test_optional_cli_manifest_and_architecture(self):
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
root, _, app, output = self.fixture(directory)
|
||||
cli = root / "build/cli.exe"
|
||||
executable(cli)
|
||||
package(root, app, output, cli)
|
||||
with zipfile.ZipFile(output) as archive:
|
||||
self.assertEqual(archive.read("searchi-cli.exe"), cli.read_bytes())
|
||||
manifest = json.loads(archive.read("PACKAGE.json"))
|
||||
record = next(row for row in manifest["files"] if row["path"] == "searchi-cli.exe")
|
||||
self.assertEqual(record["sha256"], hashlib.sha256(cli.read_bytes()).hexdigest())
|
||||
self.assertIn("--db", archive.read("AGENT-SETUP.txt").decode())
|
||||
previous = output.read_bytes()
|
||||
executable(cli, 0xAA64)
|
||||
with self.assertRaisesRegex(ValueError, "architecture differs"):
|
||||
package(root, app, output, cli)
|
||||
self.assertEqual(output.read_bytes(), previous)
|
||||
|
||||
def fixture(self, directory):
|
||||
root = Path(directory)
|
||||
resources = root / "apps/desktop/src-tauri/resources"
|
||||
|
||||
Reference in new issue
Block a user