mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-15 06:28:20 +00:00
26 lines
673 B
Go
26 lines
673 B
Go
|
package nodev1
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"runtime"
|
||
|
"strings"
|
||
|
"testing"
|
||
|
|
||
|
ptypes "github.com/gogo/protobuf/types"
|
||
|
"github.com/prysmaticlabs/prysm/shared/testutil/assert"
|
||
|
"github.com/prysmaticlabs/prysm/shared/testutil/require"
|
||
|
"github.com/prysmaticlabs/prysm/shared/version"
|
||
|
)
|
||
|
|
||
|
func TestGetVersion(t *testing.T) {
|
||
|
semVer := version.GetSemanticVersion()
|
||
|
os := runtime.GOOS
|
||
|
arch := runtime.GOARCH
|
||
|
res, err := (&Server{}).GetVersion(context.Background(), &ptypes.Empty{})
|
||
|
require.NoError(t, err)
|
||
|
v := res.Data.Version
|
||
|
assert.Equal(t, true, strings.Contains(v, semVer))
|
||
|
assert.Equal(t, true, strings.Contains(v, os))
|
||
|
assert.Equal(t, true, strings.Contains(v, arch))
|
||
|
}
|