MCPcopy Create free account
hub / github.com/cloudbase/garm / TestListAllPoolsDBFetchErr

Method TestListAllPoolsDBFetchErr

database/sql/pools_test.go:151–161  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

149}
150
151func (s *PoolsTestSuite) TestListAllPoolsDBFetchErr() {
152 s.Fixtures.SQLMock.
153 ExpectQuery(regexp.QuoteMeta("SELECT `pools`.`id`,`pools`.`created_at`,`pools`.`updated_at`,`pools`.`deleted_at`,`pools`.`provider_name`,`pools`.`runner_prefix`,`pools`.`max_runners`,`pools`.`min_idle_runners`,`pools`.`runner_bootstrap_timeout`,`pools`.`image`,`pools`.`flavor`,`pools`.`os_type`,`pools`.`os_arch`,`pools`.`enabled`,`pools`.`git_hub_runner_group`,`pools`.`enable_shell`,`pools`.`generation`,`pools`.`repo_id`,`pools`.`org_id`,`pools`.`enterprise_id`,`pools`.`template_id`,`pools`.`priority` FROM `pools` WHERE `pools`.`deleted_at` IS NULL")).
154 WillReturnError(fmt.Errorf("mocked fetching all pools error"))
155
156 _, err := s.StoreSQLMocked.ListAllPools(s.adminCtx)
157
158 s.assertSQLMockExpectations()
159 s.Require().NotNil(err)
160 s.Require().Equal("error fetching all pools: mocked fetching all pools error", err.Error())
161}
162
163func (s *PoolsTestSuite) TestGetPoolByID() {
164 pool, err := s.Store.GetPoolByID(s.adminCtx, s.Fixtures.Pools[0].ID)

Callers

nothing calls this directly

Calls 3

ListAllPoolsMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected