MCPcopy
hub / github.com/git-lfs/git-lfs / TestDeleteAccessWithEmptyString

Function TestDeleteAccessWithEmptyString

lfsapi/endpoint_finder_test.go:514–530  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

512}
513
514func TestDeleteAccessWithEmptyString(t *testing.T) {
515 finder := NewEndpointFinder(lfshttp.NewContext(nil, nil, map[string]string{
516 "lfs.http://example.com.access": "basic",
517 }))
518
519 url := "http://example.com"
520
521 access := finder.AccessFor(url)
522 assert.Equal(t, creds.BasicAccess, access.Mode())
523 assert.Equal(t, url, access.URL())
524
525 finder.SetAccess(access.Upgrade(creds.AccessMode("")))
526
527 newAccess := finder.AccessFor(url)
528 assert.Equal(t, creds.NoneAccess, newAccess.Mode())
529 assert.Equal(t, url, newAccess.URL())
530}
531
532type EndpointParsingTestCase struct {
533 Given string

Callers

nothing calls this directly

Calls 9

AccessForMethod · 0.95
SetAccessMethod · 0.95
NewContextFunction · 0.92
AccessModeTypeAlias · 0.92
NewEndpointFinderFunction · 0.85
ModeMethod · 0.80
URLMethod · 0.80
UpgradeMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected