MCPcopy Create free account
hub / github.com/dotzero/git-profile / TestImport

Function TestImport

cmd/import_test.go:10–30  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

8)
9
10func TestImport(t *testing.T) {
11 is := is.New(t)
12
13 cfg := &storageMock{
14 SaveFunc: func(filename string) error {
15 return nil
16 },
17 StoreFunc: func(profile string, key string, value string) {},
18 }
19
20 var b bytes.Buffer
21
22 cmd := Import(cfg)
23
24 cmd.SetOut(&b)
25 cmd.SetArgs([]string{"profile", `[{"key":"user.email","value":"work@example.com"}]`})
26 err := cmd.Execute()
27
28 is.NoErr(err)
29 is.Equal(trim(b.String()), "Successfully imported `profile` profile.")
30}

Callers

nothing calls this directly

Calls 3

ImportFunction · 0.85
trimFunction · 0.85
ExecuteMethod · 0.80

Tested by

no test coverage detected