diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-03-16 01:46:20 +0000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-03-16 01:46:20 +0000 |
| commit | 0e37086ee468e6e3b697c32b7f02280ee06f5116 (patch) | |
| tree | 3a1dc153ad715a4386fb844d2fa3993b0e757cf7 /internal/api/server_test.go | |
| parent | d911021b7e4a0c9f77ca9996b0ebdabb03c56696 (diff) | |
fix: permission denied and host key verification errors; add gemini elaboration fallback
Diffstat (limited to 'internal/api/server_test.go')
| -rw-r--r-- | internal/api/server_test.go | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/internal/api/server_test.go b/internal/api/server_test.go index a670f33..4899a5c 100644 --- a/internal/api/server_test.go +++ b/internal/api/server_test.go @@ -147,14 +147,16 @@ func testServerWithGeminiMockRunner(t *testing.T) (*Server, *storage.DB) { mockBinDir := t.TempDir() mockGeminiPath := filepath.Join(mockBinDir, "mock-gemini-binary.sh") mockScriptContent := `#!/bin/bash -# Mock gemini binary that outputs stream-json wrapped in markdown to stdout. -echo "```json" -echo "{\"type\":\"content_block_start\",\"content_block\":{\"text\":\"Hello, Gemini!\",\"type\":\"text\"}}" -echo "{\"type\":\"content_block_delta\",\"content_block\":{\"text\":\" How are you?\"}}" -echo "{\"type\":\"content_block_end\"}" -echo "{\"type\":\"message_delta\",\"message\":{\"role\":\"model\"}}" -echo "{\"type\":\"message_end\"}" -echo "```" +OUTPUT_FILE=$(mktemp) +echo "` + "```json" + `" > "$OUTPUT_FILE" +echo "{\"type\":\"content_block_start\",\"content_block\":{\"text\":\"Hello, Gemini!\",\"type\":\"text\"}}" >> "$OUTPUT_FILE" +echo "{\"type\":\"content_block_delta\",\"content_block\":{\"text\":\" How are you?\"}}" >> "$OUTPUT_FILE" +echo "{\"type\":\"content_block_end\"}" >> "$OUTPUT_FILE" +echo "{\"type\":\"message_delta\",\"message\":{\"role\":\"model\"}}" >> "$OUTPUT_FILE" +echo "{\"type\":\"message_end\"}" >> "$OUTPUT_FILE" +echo "` + "```" + `" >> "$OUTPUT_FILE" +cat "$OUTPUT_FILE" +rm "$OUTPUT_FILE" exit 0 ` if err := os.WriteFile(mockGeminiPath, []byte(mockScriptContent), 0755); err != nil { |
