cosmos-sdk/tests/systemtests/rest_cli.go
mergify[bot] acc35aa576
test: migrate e2e/authz to system tests (backport #21819) (#21993)
Co-authored-by: Akhil Kumar P <36399231+akhilkumarpilli@users.noreply.github.com>
2024-10-01 10:37:26 +02:00

30 lines
582 B
Go

package systemtests
import (
"testing"
"github.com/stretchr/testify/require"
"github.com/cosmos/cosmos-sdk/testutil"
)
type GRPCTestCase struct {
name string
url string
expOut string
}
// RunGRPCQueries runs given grpc testcases by making requests and
// checking response with expected output
func RunGRPCQueries(t *testing.T, testCases []GRPCTestCase) {
t.Helper()
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
resp, err := testutil.GetRequest(tc.url)
require.NoError(t, err)
require.JSONEq(t, tc.expOut, string(resp))
})
}
}