main_test.go 376 B

1234567891011121314151617181920
  1. package main
  2. import (
  3. "os"
  4. "testing"
  5. "time"
  6. "gitp78su.ipnodns.ru/svi/kern/v2/krn/kctx"
  7. "gitp78su.ipnodns.ru/svi/kern/v2/mock/mock_env"
  8. )
  9. func TestMain(t *testing.T) {
  10. _ = mock_env.MakeEnv()
  11. _ = os.Unsetenv("LOCAL_HTTP_URL")
  12. os.Setenv("LOCAL_HTTP_URL", "http://localhost:18330/")
  13. go main()
  14. time.Sleep(time.Second * 2)
  15. kCtx := kctx.GetKernelCtx()
  16. kCtx.Cancel()
  17. }