Skip to content
Snippets Groups Projects
Commit eb0287ed authored by Richard T. Carback III's avatar Richard T. Carback III
Browse files

fix test

parent 799fbff7
Branches
Tags
No related merge requests found
......@@ -5,3 +5,5 @@ require (
github.com/spf13/jwalterweatherman v1.1.0
gitlab.com/elixxir/primitives v0.0.0-20200731184040-494269b53b4d
)
go 1.13
......@@ -409,19 +409,14 @@ func TestGetNodeId(t *testing.T) {
}
// Happy path
func TestNode_GetGatewayId(t *testing.T) {
jsonData, _, err := DecodeNDF(ExampleNDF)
if err != nil {
t.Errorf("DecodeNDF() unexpectedly produced an error"+
"\n\treceived: %#v\n\texpected: %#v",
err, nil)
}
func TestGetGatewayId(t *testing.T) {
gw := Gateway{make([]byte, 33), "52.41.80.104", "-----BEGIN CERT"}
// Expected id, pulled from the global ExampleNDF
expectedId := []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
// Fetch the id
receivedGatewayId, err := jsonData.Nodes[0].GetGatewayId()
receivedGatewayId, err := gw.GetGatewayId()
if err != nil {
t.Errorf("GetGatewayId() produces an error:\n%v", err)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment