github.com/sharovik/devbot@v1.0.1-0.20240308094637-4a0387c40516/internal/container/container_test.go (about) 1 package container 2 3 import ( 4 "os" 5 "path" 6 "runtime" 7 "testing" 8 9 "github.com/sharovik/devbot/internal/log" 10 "github.com/stretchr/testify/assert" 11 ) 12 13 func init() { 14 //We switch pointer to the root directory for control the path from which we need to generate test-data file-paths 15 _, filename, _, _ := runtime.Caller(0) 16 dir := path.Join(path.Dir(filename), "../../") 17 _ = os.Chdir(dir) 18 } 19 20 func TestMain_Init(t *testing.T) { 21 c, err := Init() 22 assert.NoError(t, err) 23 assert.IsType(t, Main{}, c) 24 25 assert.Equal(t, true, c.Config.IsInitialised()) 26 assert.Equal(t, true, log.IsInitialized()) 27 }