Browse Source

macaroons test: fix formatting

master
Johan T. Halseth 4 years ago
parent
commit
65865030d6
No known key found for this signature in database
GPG Key ID: 15BAADA29DA20D26
  1. 16
      macaroons/constraints_test.go

16
macaroons/constraints_test.go

@ -19,8 +19,9 @@ var (
)
func createDummyMacaroon(t *testing.T) *macaroon.Macaroon {
dummyMacaroon, err := macaroon.New(testRootKey, testID,
testLocation, testVersion)
dummyMacaroon, err := macaroon.New(
testRootKey, testID, testLocation, testVersion,
)
if err != nil {
t.Fatalf("Error creating initial macaroon: %v", err)
}
@ -36,8 +37,9 @@ func TestAddConstraints(t *testing.T) {
// Now add a constraint and make sure we have a cloned macaroon
// with the constraint applied instead of a mutated initial one.
newMac, err := macaroons.AddConstraints(initialMac,
macaroons.TimeoutConstraint(1))
newMac, err := macaroons.AddConstraints(
initialMac, macaroons.TimeoutConstraint(1),
)
if err != nil {
t.Fatalf("Error adding constraint: %v", err)
}
@ -69,8 +71,10 @@ func TestTimeoutConstraint(t *testing.T) {
// Finally, check that the created caveat has an
// acceptable value.
if !strings.HasPrefix(string(testMacaroon.Caveats()[0].Id),
expectedTimeCaveatSubstring) {
if !strings.HasPrefix(
string(testMacaroon.Caveats()[0].Id),
expectedTimeCaveatSubstring,
) {
t.Fatalf("Added caveat '%s' does not meet the expectations!",
testMacaroon.Caveats()[0].Id)
}

Loading…
Cancel
Save