MCPcopy Create free account
hub / github.com/larksuite/cli / TestResolveInput_AtFile

Function TestResolveInput_AtFile

internal/cmdutil/resolve_test.go:114–128  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

112}
113
114func TestResolveInput_AtFile(t *testing.T) {
115 fio := &localfileio.LocalFileIO{}
116 dir := t.TempDir()
117 TestChdir(t, dir)
118 if err := os.WriteFile("params.json", []byte(`{"folder_token":"abc123"}`), 0o600); err != nil {
119 t.Fatal(err)
120 }
121 got, err := ResolveInput("@params.json", nil, fio)
122 if err != nil {
123 t.Fatalf("unexpected error: %v", err)
124 }
125 if got != `{"folder_token":"abc123"}` {
126 t.Errorf("got %q", got)
127 }
128}
129
130func TestResolveInput_AtFile_TrimsWhitespace(t *testing.T) {
131 fio := &localfileio.LocalFileIO{}

Callers

nothing calls this directly

Calls 3

TestChdirFunction · 0.85
ResolveInputFunction · 0.85
WriteFileMethod · 0.65

Tested by

no test coverage detected