Integration: @file flows through ParseJSONMap correctly.
(t *testing.T)
| 218 | |
| 219 | // Integration: @file flows through ParseJSONMap correctly. |
| 220 | func TestParseJSONMap_WithAtFile(t *testing.T) { |
| 221 | fio := &localfileio.LocalFileIO{} |
| 222 | dir := t.TempDir() |
| 223 | TestChdir(t, dir) |
| 224 | if err := os.WriteFile("params.json", []byte(`{"folder_token":"abc123","type":"folder"}`), 0o600); err != nil { |
| 225 | t.Fatal(err) |
| 226 | } |
| 227 | got, err := ParseJSONMap("@params.json", "--params", nil, fio) |
| 228 | if err != nil { |
| 229 | t.Fatalf("unexpected error: %v", err) |
| 230 | } |
| 231 | if len(got) != 2 { |
| 232 | t.Errorf("got %d keys, want 2", len(got)) |
| 233 | } |
| 234 | if got["folder_token"] != "abc123" { |
| 235 | t.Errorf("got %v, want folder_token=abc123", got) |
| 236 | } |
| 237 | } |
| 238 | |
| 239 | func TestParseOptionalBody_WithAtFile(t *testing.T) { |
| 240 | fio := &localfileio.LocalFileIO{} |
nothing calls this directly
no test coverage detected