Skip to content

Commit 7edec8c

Browse files
author
Aaron Schlesinger
committed
fix(pkg/gitreceive/storage/auth_test.go): add tests for CredsOK
1 parent 4377d05 commit 7edec8c

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

pkg/gitreceive/storage/auth_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,15 @@ func TestGetAuthSuccess(t *testing.T) {
3939
assert.NoErr(t, err)
4040
assert.True(t, creds != nil, "creds were nil when they shouldn't have been")
4141
}
42+
43+
func TestCredsOKFail(t *testing.T) {
44+
fs := sys.NewFakeFS()
45+
assert.False(t, CredsOK(fs), "true returned when there were no credentials")
46+
}
47+
48+
func TestCredsOKSuccess(t *testing.T) {
49+
fs := sys.NewFakeFS()
50+
fs.Files[accessKeyIDFile] = []byte("stuff")
51+
fs.Files[accessSecretKeyFile] = []byte("other stuff")
52+
assert.True(t, CredsOK(fs), "false returned when there were valid credentials")
53+
}

0 commit comments

Comments
 (0)