Skip to content

Commit ad1e14a

Browse files
committed
refactor: delete unused test helper code
1 parent d0ec3d1 commit ad1e14a

6 files changed

Lines changed: 0 additions & 122 deletions

File tree

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-types";
2-
import type { MockInstance } from "vitest";
32

43
export function createWhatsAppPollFixture() {
54
const cfg = { marker: "resolved-cfg" } as OpenClawConfig;
@@ -15,29 +14,3 @@ export function createWhatsAppPollFixture() {
1514
accountId: "work",
1615
};
1716
}
18-
19-
export function expectWhatsAppPollSent(
20-
sendPollWhatsApp: MockInstance,
21-
params: {
22-
cfg: OpenClawConfig;
23-
poll: { question: string; options: string[]; maxSelections: number };
24-
to?: string;
25-
accountId?: string;
26-
},
27-
) {
28-
const expected = [
29-
params.to ?? "+1555",
30-
params.poll,
31-
{
32-
verbose: false,
33-
accountId: params.accountId ?? "work",
34-
cfg: params.cfg,
35-
},
36-
];
37-
const actual = sendPollWhatsApp.mock.calls.at(-1);
38-
if (JSON.stringify(actual) !== JSON.stringify(expected)) {
39-
throw new Error(
40-
`Expected WhatsApp poll send ${JSON.stringify(expected)}, got ${JSON.stringify(actual)}`,
41-
);
42-
}
43-
}

src/agents/pi-embedded-runner/model.test-harness.ts

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -87,52 +87,6 @@ export function buildOpenAICodexForwardCompatExpectation(
8787
};
8888
}
8989

90-
const GOOGLE_GEMINI_CLI_PRO_TEMPLATE_MODEL = {
91-
id: "gemini-3-pro-preview",
92-
name: "Gemini 3 Pro Preview (Cloud Code Assist)",
93-
provider: "google-gemini-cli",
94-
api: "google-gemini-cli",
95-
baseUrl: "https://cloudcode-pa.googleapis.com",
96-
reasoning: true,
97-
input: ["text", "image"] as const,
98-
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
99-
contextWindow: 200000,
100-
maxTokens: 64000,
101-
};
102-
103-
const GOOGLE_GEMINI_CLI_FLASH_TEMPLATE_MODEL = {
104-
id: "gemini-3-flash-preview",
105-
name: "Gemini 3 Flash Preview (Cloud Code Assist)",
106-
provider: "google-gemini-cli",
107-
api: "google-gemini-cli",
108-
baseUrl: "https://cloudcode-pa.googleapis.com",
109-
reasoning: false,
110-
input: ["text", "image"] as const,
111-
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
112-
contextWindow: 200000,
113-
maxTokens: 64000,
114-
};
115-
116-
export function mockGoogleGeminiCliProTemplateModel(discoverModelsMock: DiscoverModelsMock): void {
117-
mockTemplateModel(
118-
discoverModelsMock,
119-
"google-gemini-cli",
120-
"gemini-3-pro-preview",
121-
GOOGLE_GEMINI_CLI_PRO_TEMPLATE_MODEL,
122-
);
123-
}
124-
125-
export function mockGoogleGeminiCliFlashTemplateModel(
126-
discoverModelsMock: DiscoverModelsMock,
127-
): void {
128-
mockTemplateModel(
129-
discoverModelsMock,
130-
"google-gemini-cli",
131-
"gemini-3-flash-preview",
132-
GOOGLE_GEMINI_CLI_FLASH_TEMPLATE_MODEL,
133-
);
134-
}
135-
13690
export function resetMockDiscoverModels(discoverModelsMock: DiscoverModelsMock): void {
13791
vi.mocked(discoverModelsMock).mockReturnValue({
13892
find: vi.fn(() => null),

src/agents/pi-embedded-runner/run/attempt.spawn-workspace.test-support.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -877,14 +877,6 @@ export const testModel = {
877877
input: ["text"],
878878
} as unknown as Model<Api>;
879879

880-
export const cacheTtlEligibleModel = {
881-
api: "anthropic",
882-
provider: "anthropic",
883-
compat: {},
884-
contextWindow: 8192,
885-
input: ["text"],
886-
} as unknown as Model<Api>;
887-
888880
const testAuthStorage = {
889881
getApiKey: async () => undefined,
890882
};

src/agents/sandbox/fs-bridge.test-helpers.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,6 @@ export function getDockerArg(args: string[], position: number): string {
8686
return args[DOCKER_FIRST_SCRIPT_ARG_INDEX + position - 1] ?? "";
8787
}
8888

89-
export function getDockerPathArg(args: string[]): string {
90-
return getDockerArg(args, 1);
91-
}
92-
9389
export function getScriptsFromCalls(): string[] {
9490
return mockedExecDockerRaw.mock.calls.map(([args]) => getDockerScript(args));
9591
}

src/gateway/server-methods/chat.test-helpers.ts

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,3 @@ export function createTranscriptFixtureSync(params: {
2323
);
2424
return { dir, transcriptPath };
2525
}
26-
27-
export function createMockSessionEntry(params: {
28-
transcriptPath: string;
29-
sessionId: string;
30-
canonicalKey?: string;
31-
cfg?: Record<string, unknown>;
32-
}) {
33-
return {
34-
cfg: params.cfg ?? {},
35-
storePath: path.join(path.dirname(params.transcriptPath), "sessions.json"),
36-
entry: {
37-
sessionId: params.sessionId,
38-
sessionFile: params.transcriptPath,
39-
},
40-
canonicalKey: params.canonicalKey ?? "main",
41-
};
42-
}

src/process/test-timeouts.ts

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)