Skip to content

Commit 7325430

Browse files
committed
libgit2/managed/http: test for incomplete creds
Add test for createClientRequest() where the credentials are incomplete. Signed-off-by: Sunny <[email protected]>
1 parent bc28ad5 commit 7325430

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pkg/git/libgit2/managed/http_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,16 @@ func TestHttpAction_CreateClientRequest(t *testing.T) {
105105
},
106106
wantedErr: nil,
107107
},
108+
{
109+
name: "incomplete credentials, no basic auth",
110+
action: git2go.SmartServiceActionReceivepackLs,
111+
transport: &http.Transport{},
112+
authOpts: git.AuthOptions{Username: "user"},
113+
assertFunc: func(g *WithT, req *http.Request, client *http.Client) {
114+
_, _, ok := req.BasicAuth()
115+
g.Expect(ok).To(BeFalse())
116+
},
117+
},
108118
{
109119
name: "credentials are correctly configured",
110120
action: git2go.SmartServiceActionUploadpack,

0 commit comments

Comments
 (0)