Skip to content

Commit

Permalink
Add TestGetSignerUIDShouldFailOnDeviceError ref fibercrypto#139
Browse files Browse the repository at this point in the history
  • Loading branch information
stdevAlDen committed Oct 14, 2019
1 parent 14d3bc0 commit c4d7f5f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/hardware/sky-wallet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,19 @@ func TestGetSignerUIDShouldFailForUninitializedDevice(t *testing.T) {
// When
devId := sw.GetSignerUID()

// Then
require.Equal(t, core.UID("undefined"), devId)
}

func TestGetSignerUIDShouldFailOnDeviceError(t *testing.T) {
// Giving
dev := mocks.Devicer{}
dev.On("GetFeatures").Return(wire.Message{}, errors.New(""))
sw := NewSkyWallet(&dev)

// When
devId := sw.GetSignerUID()

// Then
require.Equal(t, core.UID("undefined"), devId)
}

0 comments on commit c4d7f5f

Please sign in to comment.