1
0
Fork 0
forked from lthn/blockchain
blockchain/utils/sdk/client/go/test/api_block_test.go
Snider 884958b0c7 Add Go SDK client for Lethean Blockchain API
Introduces a generated Go SDK client for the Lethean Blockchain API, including OpenAPI spec, models, API interfaces, documentation, and tests. This enables Go applications to interact with Lethean blockchain endpoints for block, info, and transaction operations.
2025-10-19 14:49:39 +01:00

87 lines
1.9 KiB
Go
Generated

/*
Lethean Blockchain API
Testing BlockAPIService
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech);
package lthn
import (
"context"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"testing"
openapiclient "github.com/letheanVPN/blockchain/lthn"
)
func Test_lthn_BlockAPIService(t *testing.T) {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
t.Run("Test BlockAPIService CreateBlockTemplate", func(t *testing.T) {
t.Skip("skip test") // remove to run test
resp, httpRes, err := apiClient.BlockAPI.CreateBlockTemplate(context.Background()).Execute()
require.Nil(t, err)
require.NotNil(t, resp)
assert.Equal(t, 200, httpRes.StatusCode)
})
t.Run("Test BlockAPIService GetBlock", func(t *testing.T) {
t.Skip("skip test") // remove to run test
var identifier string
resp, httpRes, err := apiClient.BlockAPI.GetBlock(context.Background(), identifier).Execute()
require.Nil(t, err)
require.NotNil(t, resp)
assert.Equal(t, 200, httpRes.StatusCode)
})
t.Run("Test BlockAPIService GetBlocks", func(t *testing.T) {
t.Skip("skip test") // remove to run test
resp, httpRes, err := apiClient.BlockAPI.GetBlocks(context.Background()).Execute()
require.Nil(t, err)
require.NotNil(t, resp)
assert.Equal(t, 200, httpRes.StatusCode)
})
t.Run("Test BlockAPIService GetHeight", func(t *testing.T) {
t.Skip("skip test") // remove to run test
resp, httpRes, err := apiClient.BlockAPI.GetHeight(context.Background()).Execute()
require.Nil(t, err)
require.NotNil(t, resp)
assert.Equal(t, 200, httpRes.StatusCode)
})
t.Run("Test BlockAPIService SubmitBlock", func(t *testing.T) {
t.Skip("skip test") // remove to run test
resp, httpRes, err := apiClient.BlockAPI.SubmitBlock(context.Background()).Execute()
require.Nil(t, err)
require.NotNil(t, resp)
assert.Equal(t, 200, httpRes.StatusCode)
})
}