MCPcopy Create free account
hub / github.com/cortexproject/cortex / TestSingleResolver

Function TestSingleResolver

pkg/util/users/resolver_test.go:105–123  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

103}
104
105func TestSingleResolver(t *testing.T) {
106 r := NewSingleResolver()
107 for _, tc := range append(commonResolverTestCases, []resolverTestCase{
108 {
109 name: "multi-tenant",
110 headerValue: strptr("tenant-a|tenant-b"),
111 errTenantID: &errTenantIDUnsupportedCharacter{pos: 8, tenantID: "tenant-a|tenant-b"},
112 errTenantIDs: &errTenantIDUnsupportedCharacter{pos: 8, tenantID: "tenant-a|tenant-b"},
113 },
114 {
115 name: "containing-invalid-character",
116 headerValue: strptr("+"),
117 errTenantID: &errTenantIDUnsupportedCharacter{pos: 0, tenantID: "+"},
118 errTenantIDs: &errTenantIDUnsupportedCharacter{pos: 0, tenantID: "+"},
119 },
120 }...) {
121 t.Run(tc.name, tc.test(r))
122 }
123}
124
125func TestMultiResolver(t *testing.T) {
126 r := NewMultiResolver()

Callers

nothing calls this directly

Calls 4

NewSingleResolverFunction · 0.85
strptrFunction · 0.85
testMethod · 0.80
RunMethod · 0.65

Tested by

no test coverage detected