2021-11-09 14:15:45 +00:00
|
|
|
package rpc
|
|
|
|
|
|
|
|
import (
|
|
|
|
"bytes"
|
2022-06-13 18:30:35 +00:00
|
|
|
"context"
|
2021-11-09 14:15:45 +00:00
|
|
|
"net/http"
|
|
|
|
"testing"
|
|
|
|
|
2022-06-13 18:30:35 +00:00
|
|
|
"github.com/status-im/go-waku/waku/v2/node"
|
2021-11-09 14:15:45 +00:00
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestGetV1Info(t *testing.T) {
|
|
|
|
var reply InfoReply
|
|
|
|
|
|
|
|
request, err := http.NewRequest(http.MethodPost, "url", bytes.NewReader([]byte("")))
|
|
|
|
require.NoError(t, err)
|
|
|
|
|
2022-06-13 18:30:35 +00:00
|
|
|
wakuNode1, err := node.New(context.Background())
|
|
|
|
require.NoError(t, err)
|
|
|
|
defer wakuNode1.Stop()
|
|
|
|
err = wakuNode1.Start()
|
|
|
|
require.NoError(t, err)
|
|
|
|
|
|
|
|
d := &DebugService{
|
|
|
|
node: wakuNode1,
|
|
|
|
}
|
2021-11-09 14:15:45 +00:00
|
|
|
|
|
|
|
err = d.GetV1Info(request, &InfoArgs{}, &reply)
|
|
|
|
require.NoError(t, err)
|
|
|
|
}
|