fix(python): validate marshal coverage and consolidate pyc tests (#14036)

This commit is contained in:
morluto authored and GitHub committed 2026-11-23 06:55:30 -05:00
1 parent ca26f2ac84
commit 4ff98b84fb
9 files changed
+234 -273

No files matched your search

+1 -16
View File
@@ -1,10 +1,5 @@
import { expect, it } from "vitest";
import {
inspectPythonPycInputSchema,
pythonPycMarshalProfile,
PYTHON_PYC_MARSHAL_PROFILES,
pythonPycHeaderSchema,
} from "./pythonPyc.js";
import { pythonPycMarshalProfile, pythonPycHeaderSchema } from "./pythonPyc.js";
import {
observePythonBytecodePrefix,
pythonBytecodeIdentity,
@@ -100,7 +95,6 @@ it("keeps pinned CPython identity separate from standalone marshal coverage", ()
}
expect(pythonPycMarshalProfile(3450)).toBeNull();
expect(pythonPycMarshalProfile(62171)).toBeNull();
expect(PYTHON_PYC_MARSHAL_PROFILES.size).toBeGreaterThan(80);
});
it("retains little-endian magic inside a borrowed, partially available prefix", () => {
@@ -125,12 +119,3 @@ it("retains little-endian magic inside a borrowed, partially available prefix",
expect(complete.prefix.byteOffset).toBe(bytes.byteOffset);
expect(complete.prefix.byteLength).toBe(4);
});
it("rejects extra inspect arguments", () => {
expect(
inspectPythonPycInputSchema.safeParse({
path: "/artifacts/module.pyc",
detail: "complete",
}).success,
).toBe(false);
});