You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1001 B

  1. package tests
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/stretchr/testify/assert"
  6. abciclientent "github.com/tendermint/tendermint/abci/client"
  7. "github.com/tendermint/tendermint/abci/example/kvstore"
  8. abciserver "github.com/tendermint/tendermint/abci/server"
  9. "github.com/tendermint/tendermint/libs/log"
  10. )
  11. func TestClientServerNoAddrPrefix(t *testing.T) {
  12. ctx, cancel := context.WithCancel(context.Background())
  13. defer cancel()
  14. const (
  15. addr = "localhost:26658"
  16. transport = "socket"
  17. )
  18. app := kvstore.NewApplication()
  19. logger := log.NewTestingLogger(t)
  20. server, err := abciserver.NewServer(logger, addr, transport, app)
  21. assert.NoError(t, err, "expected no error on NewServer")
  22. err = server.Start(ctx)
  23. assert.NoError(t, err, "expected no error on server.Start")
  24. client, err := abciclientent.NewClient(logger, addr, transport, true)
  25. assert.NoError(t, err, "expected no error on NewClient")
  26. err = client.Start(ctx)
  27. assert.NoError(t, err, "expected no error on client.Start")
  28. }