Skip to content

Commit

Permalink
feat: simplify test code
Browse files Browse the repository at this point in the history
  • Loading branch information
kian99 committed Aug 16, 2024
1 parent dc25c74 commit e356153
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions internal/juju/jaas_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ func (s *JaasSuite) getJaasClient() jaasClient {
}

func (s *JaasSuite) TestAddRelations() {
ctlr := s.setupMocks(s.T())
defer ctlr.Finish()
defer s.setupMocks(s.T()).Finish()

tuples := []JaasTuple{
{Object: "object-1", Relation: "relation", Target: "target-1"},
Expand Down Expand Up @@ -67,8 +66,7 @@ func (s *JaasSuite) TestAddRelationsEmptySlice() {
}

func (s *JaasSuite) TestDeleteRelations() {
ctlr := s.setupMocks(s.T())
defer ctlr.Finish()
defer s.setupMocks(s.T()).Finish()

tuples := []JaasTuple{
{Object: "object-1", Relation: "relation", Target: "target-1"},
Expand Down Expand Up @@ -96,8 +94,7 @@ func (s *JaasSuite) TestDeleteRelationsEmptySlice() {
}

func (s *JaasSuite) TestReadRelations() {
ctlr := s.setupMocks(s.T())
defer ctlr.Finish()
defer s.setupMocks(s.T()).Finish()

tuple := JaasTuple{Object: "object-1", Relation: "relation", Target: "target-1"}
// 1st request/response has no token in the request and a token in the response indicating another page is available.
Expand Down Expand Up @@ -134,8 +131,7 @@ func (s *JaasSuite) TestReadRelationsEmptyTuple() {
}

func (s *JaasSuite) TestReadRelationsCancelledContext() {
ctlr := s.setupMocks(s.T())
defer ctlr.Finish()
defer s.setupMocks(s.T()).Finish()

tuple := JaasTuple{Object: "object-1", Relation: "relation", Target: "target-1"}
req := &params.ListRelationshipTuplesRequest{Tuple: toAPITuple(tuple)}
Expand Down

0 comments on commit e356153

Please sign in to comment.