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

Function TestNewUploadManagerFactory_customOption

ots3/dependency_test.go:33–52  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

31}
32
33func TestNewUploadManagerFactory_customOption(t *testing.T) {
34 dispatcher := &events.SyncDispatcher{}
35 var called bool
36 s3out := provideFactory(&providersOption{ctor: func(args ManagerArgs) (*Manager, error) {
37 called = true
38 return newManager(args)
39 }, reloadable: true})(factoryIn{
40 Conf: config.MapAdapter{"s3": map[string]S3Config{
41 "default": {},
42 "alternative": {},
43 }},
44 Populator: Populator{},
45 Dispatcher: dispatcher,
46 })
47 def, err := s3out.Factory.Make("default")
48 assert.NoError(t, err)
49 assert.NotNil(t, def)
50 assert.True(t, called)
51 assert.Equal(t, 1, dispatcher.ListenerCount(events.OnReload))
52}
53
54type exportedConfig struct {
55 di.In

Callers

nothing calls this directly

Calls 4

ListenerCountMethod · 0.95
newManagerFunction · 0.85
provideFactoryFunction · 0.70
MakeMethod · 0.65

Tested by

no test coverage detected