MCPcopy Create free account
hub / github.com/DoNewsCode/core / TestC_Default

Function TestC_Default

c_test.go:111–130  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

109}
110
111func TestC_Default(t *testing.T) {
112 c := New()
113 c.ProvideEssentials()
114 c.Provide(otgorm.Providers())
115 c.AddModuleFunc(config.New)
116
117 f, _ := ioutil.TempFile("./", "*")
118 defer func() {
119 f.Close()
120 os.Remove(f.Name())
121 }()
122
123 rootCommand := &cobra.Command{}
124 c.ApplyRootCommand(rootCommand)
125 rootCommand.SetArgs([]string{"config", "init", "-o", f.Name()})
126 rootCommand.Execute()
127
128 output, _ := ioutil.ReadFile(f.Name())
129 assert.Contains(t, string(output), "gorm:")
130}
131
132type m1 struct {
133 A int

Callers

nothing calls this directly

Calls 8

ProvidersFunction · 0.92
ProvideEssentialsMethod · 0.80
ProvideMethod · 0.80
AddModuleFuncMethod · 0.80
CloseMethod · 0.80
RemoveMethod · 0.80
ApplyRootCommandMethod · 0.80
NewFunction · 0.70

Tested by

no test coverage detected