Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kian99 committed Aug 23, 2023
1 parent f033bca commit 2c229ec
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions internal/openfga/openfga_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -477,8 +477,8 @@ func (s *openFGATestSuite) TestListObjectsWithContextualTuples(c *gc.C) {
c.Assert(cmp.Equal(
ids,
expected,
cmpopts.SortSlices(func(want string, expected string) bool {
return want < expected
cmpopts.SortSlices(func(want cofga.Entity, expected cofga.Entity) bool {
return want.ID < expected.ID
}),
), gc.Equals, true)
}
Expand All @@ -492,9 +492,12 @@ func (s *openFGATestSuite) TestListObjectsWithPeristedTuples(c *gc.C) {
"30000000-0000-0000-0000-000000000000",
}

expected := make([]string, len(modelUUIDs))
expected := make([]cofga.Entity, len(modelUUIDs))
for i, v := range modelUUIDs {
expected[i] = "model:" + v
expected[i] = cofga.Entity{
Kind: "model",
ID: v,
}
}

c.Assert(s.ofgaClient.AddRelation(ctx,
Expand Down Expand Up @@ -534,8 +537,8 @@ func (s *openFGATestSuite) TestListObjectsWithPeristedTuples(c *gc.C) {
c.Assert(cmp.Equal(
ids,
expected,
cmpopts.SortSlices(func(want string, expected string) bool {
return want < expected
cmpopts.SortSlices(func(want cofga.Entity, expected cofga.Entity) bool {
return want.ID < expected.ID
}),
), gc.Equals, true)
}
Expand Down

0 comments on commit 2c229ec

Please sign in to comment.