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

Method TestDeleteOrganization

runner/organizations_test.go:332–342  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

330}
331
332func (s *OrgTestSuite) TestDeleteOrganization() {
333 s.Fixtures.PoolMgrCtrlMock.On("DeleteOrgPoolManager", mock.AnythingOfType("params.Organization")).Return(nil)
334
335 err := s.Runner.DeleteOrganization(s.Fixtures.AdminContext, s.Fixtures.StoreOrgs["test-org-3"].ID, true)
336
337 s.Fixtures.PoolMgrCtrlMock.AssertExpectations(s.T())
338 s.Require().Nil(err)
339
340 _, err = s.Fixtures.Store.GetOrganizationByID(s.Fixtures.AdminContext, s.Fixtures.StoreOrgs["test-org-3"].ID)
341 s.Require().Equal("error fetching org: not found", err.Error())
342}
343
344func (s *OrgTestSuite) TestDeleteOrganizationErrUnauthorized() {
345 err := s.Runner.DeleteOrganization(context.Background(), "dummy-org-id", true)

Callers

nothing calls this directly

Calls 4

DeleteOrganizationMethod · 0.65
GetOrganizationByIDMethod · 0.65
ReturnMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected