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

Function TestChangeAccess

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

Source from the content-addressed store, hash-verified

477}
478
479func TestChangeAccess(t *testing.T) {
480 finder := NewEndpointFinder(lfshttp.NewContext(nil, nil, map[string]string{
481 "lfs.http://example.com.access": "basic",
482 }))
483
484 url := "http://example.com"
485 access := finder.AccessFor(url)
486 assert.Equal(t, creds.BasicAccess, access.Mode())
487 assert.Equal(t, url, access.URL())
488
489 finder.SetAccess(access.Upgrade(creds.NegotiateAccess))
490
491 newAccess := finder.AccessFor(url)
492 assert.Equal(t, creds.NegotiateAccess, newAccess.Mode())
493 assert.Equal(t, url, newAccess.URL())
494}
495
496func TestDeleteAccessWithNone(t *testing.T) {
497 finder := NewEndpointFinder(lfshttp.NewContext(nil, nil, map[string]string{

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected