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
No related branches found
No related tags found
No related merge requests found
...@@ -5,3 +5,5 @@ require ( ...@@ -5,3 +5,5 @@ require (
github.com/spf13/jwalterweatherman v1.1.0 github.com/spf13/jwalterweatherman v1.1.0
gitlab.com/elixxir/primitives v0.0.0-20200731184040-494269b53b4d gitlab.com/elixxir/primitives v0.0.0-20200731184040-494269b53b4d
) )
go 1.13
...@@ -409,19 +409,14 @@ func TestGetNodeId(t *testing.T) { ...@@ -409,19 +409,14 @@ func TestGetNodeId(t *testing.T) {
} }
// Happy path // Happy path
func TestNode_GetGatewayId(t *testing.T) { func TestGetGatewayId(t *testing.T) {
jsonData, _, err := DecodeNDF(ExampleNDF) gw := Gateway{make([]byte, 33), "52.41.80.104", "-----BEGIN CERT"}
if err != nil {
t.Errorf("DecodeNDF() unexpectedly produced an error"+
"\n\treceived: %#v\n\texpected: %#v",
err, nil)
}
// Expected id, pulled from the global ExampleNDF // 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} 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 // Fetch the id
receivedGatewayId, err := jsonData.Nodes[0].GetGatewayId() receivedGatewayId, err := gw.GetGatewayId()
if err != nil { if err != nil {
t.Errorf("GetGatewayId() produces an error:\n%v", err) 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