libgit2/managed/http: test for incomplete creds

Add test for createClientRequest() where the credentials are incomplete.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
This commit is contained in:
Sunny 2022-06-23 15:31:46 +05:30
parent bc28ad5d1b
commit 7325430bc9
No known key found for this signature in database
GPG Key ID: 9F3D25DDFF7FA3CF
1 changed files with 10 additions and 0 deletions

View File

@ -105,6 +105,16 @@ func TestHttpAction_CreateClientRequest(t *testing.T) {
},
wantedErr: nil,
},
{
name: "incomplete credentials, no basic auth",
action: git2go.SmartServiceActionReceivepackLs,
transport: &http.Transport{},
authOpts: git.AuthOptions{Username: "user"},
assertFunc: func(g *WithT, req *http.Request, client *http.Client) {
_, _, ok := req.BasicAuth()
g.Expect(ok).To(BeFalse())
},
},
{
name: "credentials are correctly configured",
action: git2go.SmartServiceActionUploadpack,