Skip to content

Commit 92b9bd0

Browse files
author
Aaron Schlesinger
committed
fix(pkg/gitreceive/storage/auth_test.go): add last test for getAuth
1 parent 81cd21f commit 92b9bd0

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

pkg/gitreceive/storage/auth_test.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,12 @@ func TestGetAuthMissingSecret(t *testing.T) {
3030
assert.Err(t, err, errMissingSecret)
3131
assert.True(t, creds == nil, "returned credentials were not nil")
3232
}
33+
34+
func TestGetAuthSuccess(t *testing.T) {
35+
fs := sys.NewFakeFS()
36+
fs.Files[accessKeyIDFile] = []byte("invalid")
37+
fs.Files[accessSecretKeyFile] = []byte("also invalid")
38+
creds, err := getAuth(fs)
39+
assert.NoErr(t, err)
40+
assert.True(t, creds != nil, "creds were nil when they shouldn't have been")
41+
}

0 commit comments

Comments
 (0)