MCPcopy Create free account
hub / github.com/Permify/permify / TestUniqueAttributeIterator

Function TestUniqueAttributeIterator

pkg/database/iterators_test.go:283–395  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

281}
282
283func TestUniqueAttributeIterator(t *testing.T) {
284 isPublic, err := anypb.New(&base.BooleanValue{Data: true})
285 assert.NoError(t, err)
286
287 // Create some attributes
288 attribute1 := &base.Attribute{
289 Entity: &base.Entity{
290 Type: "entity",
291 Id: "e1",
292 },
293 Attribute: "public",
294 Value: isPublic,
295 }
296
297 attribute2 := &base.Attribute{
298 Entity: &base.Entity{
299 Type: "entity",
300 Id: "e2",
301 },
302 Attribute: "public",
303 Value: isPublic,
304 }
305
306 attribute3 := &base.Attribute{
307 Entity: &base.Entity{
308 Type: "entity",
309 Id: "e3",
310 },
311 Attribute: "public",
312 Value: isPublic,
313 }
314
315 attribute4 := &base.Attribute{
316 Entity: &base.Entity{
317 Type: "entity",
318 Id: "e4",
319 },
320 Attribute: "public",
321 Value: isPublic,
322 }
323
324 attribute5 := &base.Attribute{
325 Entity: &base.Entity{
326 Type: "entity",
327 Id: "e5",
328 },
329 Attribute: "public",
330 Value: isPublic,
331 }
332
333 attribute6 := &base.Attribute{
334 Entity: &base.Entity{
335 Type: "entity",
336 Id: "e6",
337 },
338 Attribute: "public",
339 Value: isPublic,
340 }

Callers

nothing calls this directly

Calls 5

HasNextMethod · 0.95
GetNextMethod · 0.95
NewAttributeIteratorFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected