Skip to content

Commit

Permalink
fixing an ineffassign error
Browse files Browse the repository at this point in the history
Signed-off-by: David Lawrence <[email protected]> (github: endophage)
  • Loading branch information
David Lawrence committed Feb 22, 2017
1 parent f4e38f4 commit 136a8cf
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion client/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (

log "github.com/Sirupsen/logrus"
"github.com/docker/notary/client/changelist"
"github.com/docker/notary/storage"
"github.com/docker/notary/tuf/data"
"github.com/docker/notary/tuf/testutils"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -1023,14 +1024,19 @@ func TestAllNotNearExpiry(t *testing.T) {
}

func TestRotateRemoteKeyOffline(t *testing.T) {
// http store requires an absolute baseURL
_, err := getRemoteStore("invalidURL", "gun", nil)
require.Error(t, err)

// without a valid roundtripper, rotation should fail since we cannot initialize a HTTPStore
remote, err := getRemoteStore("invalidURL", "gun", nil)
var remote storage.RemoteStore = storage.OfflineStore{}
key, err := rotateRemoteKey(data.CanonicalSnapshotRole, remote)
require.Error(t, err)
require.Nil(t, key)

// if the underlying remote store is faulty and cannot rotate keys, we should get back the error
remote, err = getRemoteStore("https://notary-server", "gun", http.DefaultTransport)
require.NoError(t, err)
key, err = rotateRemoteKey(data.CanonicalSnapshotRole, remote)
require.Error(t, err)
require.Nil(t, key)
Expand Down

0 comments on commit 136a8cf

Please sign in to comment.