MCPcopy
hub / github.com/containerd/containerd / TestRepositoryScope

Function TestRepositoryScope

core/remotes/docker/scope_test.go:27–57  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

25)
26
27func TestRepositoryScope(t *testing.T) {
28 testCases := []struct {
29 refspec reference.Spec
30 push bool
31 expected string
32 }{
33 {
34 refspec: reference.Spec{
35 Locator: "host/foo/bar",
36 Object: "ignored",
37 },
38 push: false,
39 expected: "repository:foo/bar:pull",
40 },
41 {
42 refspec: reference.Spec{
43 Locator: "host:4242/foo/bar",
44 Object: "ignored",
45 },
46 push: true,
47 expected: "repository:foo/bar:pull,push",
48 },
49 }
50 for _, x := range testCases {
51 t.Run(x.refspec.String(), func(t *testing.T) {
52 actual, err := RepositoryScope(x.refspec, x.push)
53 assert.NoError(t, err)
54 assert.Equal(t, x.expected, actual)
55 })
56 }
57}
58
59func TestGetTokenScopes(t *testing.T) {
60 testCases := []struct {

Callers

nothing calls this directly

Calls 3

RepositoryScopeFunction · 0.85
RunMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…