main_test.go 480 B

1234567891011121314151617181920212223
  1. package main
  2. import (
  3. "os"
  4. "testing"
  5. "time"
  6. "gitp78su.ipnodns.ru/svi/kern/v4/d0"
  7. "gitp78su.ipnodns.ru/svi/kern/v4/d1/mock_env"
  8. "gitp78su.ipnodns.ru/svi/kern/v4/d2/kern_ctx"
  9. )
  10. func TestMain(t *testing.T) {
  11. t.Log("TestMain")
  12. owner:=d0.LetOwner(1,"test_demo")
  13. _ = mock_env.MakeEnv(owner)
  14. _ = os.Unsetenv("LOCAL_HTTP_URL")
  15. _ = os.Setenv("LOCAL_HTTP_URL", "http://localhost:18332/")
  16. go main()
  17. time.Sleep(time.Second * 2)
  18. kCtx := kern_ctx.GetKernCtx()
  19. kCtx.Cancel()
  20. }