main_test.go 400 B

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