Add Enterprise tests
This commit is contained in:
parent
0869073906
commit
cb5baeb547
9 changed files with 640 additions and 141 deletions
|
|
@ -22,7 +22,6 @@ import (
|
|||
garmTesting "garm/internal/testing"
|
||||
"garm/params"
|
||||
"regexp"
|
||||
"sort"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/suite"
|
||||
|
|
@ -45,17 +44,6 @@ type PoolsTestSuite struct {
|
|||
Fixtures *PoolsTestFixtures
|
||||
}
|
||||
|
||||
func (s *PoolsTestSuite) equalPoolsByID(expected, actual []params.Pool) {
|
||||
s.Require().Equal(len(expected), len(actual))
|
||||
|
||||
sort.Slice(expected, func(i, j int) bool { return expected[i].ID > expected[j].ID })
|
||||
sort.Slice(actual, func(i, j int) bool { return actual[i].ID > actual[j].ID })
|
||||
|
||||
for i := 0; i < len(expected); i++ {
|
||||
s.Require().Equal(expected[i].ID, actual[i].ID)
|
||||
}
|
||||
}
|
||||
|
||||
func (s *PoolsTestSuite) assertSQLMockExpectations() {
|
||||
err := s.Fixtures.SQLMock.ExpectationsWereMet()
|
||||
if err != nil {
|
||||
|
|
@ -134,7 +122,7 @@ func (s *PoolsTestSuite) TestListAllPools() {
|
|||
pools, err := s.Store.ListAllPools(context.Background())
|
||||
|
||||
s.Require().Nil(err)
|
||||
s.equalPoolsByID(s.Fixtures.Pools, pools)
|
||||
garmTesting.EqualDBEntityID(s.T(), s.Fixtures.Pools, pools)
|
||||
}
|
||||
|
||||
func (s *PoolsTestSuite) TestListAllPoolsDBFetchErr() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue