Skip to content

Commit

Permalink
add TestRevokePaperDevice
Browse files Browse the repository at this point in the history
  • Loading branch information
mlsteele committed May 2, 2017
1 parent 47a28df commit 093a8c2
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions go/engine/revoke_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package engine
import (
"github.com/keybase/client/go/libkb"
keybase1 "github.com/keybase/client/go/protocol/keybase1"
"github.com/stretchr/testify/require"
"golang.org/x/net/context"
"testing"
)
Expand Down Expand Up @@ -98,6 +99,28 @@ func TestRevokeDevice(t *testing.T) {
assertNumDevicesAndKeys(tc, u, 1, 2)
}

func TestRevokePaperDevice(t *testing.T) {
tc := SetupEngineTest(t, "rev")
defer tc.Cleanup()

u := CreateAndSignupFakeUserPaper(tc, "rev")

assertNumDevicesAndKeys(tc, u, 2, 4)

devices, _ := getActiveDevicesAndKeys(tc, u)
var thisDevice *libkb.Device
for _, device := range devices {
if device.Type == libkb.DeviceTypePaper {
thisDevice = device
}
}

err := doRevokeDevice(tc, u, thisDevice.ID, false)
require.NoError(t, err)

assertNumDevicesAndKeys(tc, u, 1, 2)
}

func TestRevokeKey(t *testing.T) {
tc := SetupEngineTest(t, "rev")
defer tc.Cleanup()
Expand Down

0 comments on commit 093a8c2

Please sign in to comment.