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"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/require"
|
2022-11-09 19:53:01 +00:00
|
|
|
"github.com/waku-org/go-waku/waku/v2/node"
|
2021-11-09 14:15:45 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestGetV1Info(t *testing.T) {
|
|
|
|
var reply InfoReply
|
|
|
|
|
|
|
|
request, err := http.NewRequest(http.MethodPost, "url", bytes.NewReader([]byte("")))
|
|
|
|
require.NoError(t, err)
|
|
|
|
|
2023-01-06 22:37:57 +00:00
|
|
|
wakuNode1, err := node.New()
|
2022-06-13 18:30:35 +00:00
|
|
|
require.NoError(t, err)
|
|
|
|
defer wakuNode1.Stop()
|
2023-01-06 22:37:57 +00:00
|
|
|
err = wakuNode1.Start(context.Background())
|
2022-06-13 18:30:35 +00:00
|
|
|
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)
|
|
|
|
}
|