MCPcopy
hub / github.com/gogf/gf / TestLoader_StopWatchWithoutWatcher

Function TestLoader_StopWatchWithoutWatcher

os/gcfg/gcfg_z_unit_loader_test.go:327–345  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

325}
326
327func TestLoader_StopWatchWithoutWatcher(t *testing.T) {
328 gtest.C(t, func(t *gtest.T) {
329 // Create a new config instance
330 cfg, err := gcfg.NewAdapterContent(configContent)
331 t.AssertNil(err)
332
333 // Create loader without starting to watch
334 loader := gcfg.NewLoaderWithAdapter[TestConfig](cfg, "")
335
336 // Initially, should not be watching
337 t.Assert(loader.IsWatching(), false)
338
339 // Try to stop watching when not watching
340 stopped, err := loader.StopWatch(context.Background())
341 t.AssertNE(err, nil)
342 t.Assert(stopped, false)
343 t.Assert(err.Error(), "No watcher name specified")
344 })
345}

Callers

nothing calls this directly

Calls 8

CFunction · 0.92
NewAdapterContentFunction · 0.92
AssertNilMethod · 0.80
AssertMethod · 0.80
StopWatchMethod · 0.80
AssertNEMethod · 0.80
IsWatchingMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…