def setUp(self): super(RepoUnitAssociationManagerTests, self).setUp() database.update_database([TYPE_1_DEF, TYPE_2_DEF, MOCK_TYPE_DEF]) mock_plugins.install() self.manager = association_manager.RepoUnitAssociationManager() self.content_manager = content_cud_manager.ContentManager() # Set up a valid configured repo for the tests self.repo_id = 'associate-repo' with mock.patch('pulp.server.controllers.importer.model.Repository'): importer_controller.set_importer(self.repo_id, 'mock-importer', {}) # Create units that can be associated to a repo self.unit_type_id = 'mock-type' self.unit_id = 'test-unit-id' self.unit_key = {'key-1': 'test-unit'} self.content_manager.add_content_unit(self.unit_type_id, self.unit_id, self.unit_key) self.unit_id_2 = 'test-unit-id-2' self.unit_key_2 = {'key-1': 'test-unit-2'} self.content_manager.add_content_unit(self.unit_type_id, self.unit_id_2, self.unit_key_2)
def setUp(self): super(UnitAssociationQueryTests, self).setUp() database.update_database(_QUERY_TYPES) self.manager = association_query_manager.RepoUnitAssociationQueryManager() self.association_manager = association_manager.RepoUnitAssociationManager() self.content_manager = content_cud_manager.ContentManager() self._populate()
def setUp(self): super(UnitAssociationQueryTests, self).setUp() database.update_database(_QUERY_TYPES) self.manager = association_query_manager.RepoUnitAssociationQueryManager() self.association_manager = association_manager.RepoUnitAssociationManager() self.content_manager = content_cud_manager.ContentManager() # so we don't try to refresh the unit count on non-existing repos manager_factory._CLASSES[manager_factory.TYPE_REPO] = mock.MagicMock() self._populate()
def setUp(self, mock_repo_qs, mock_imp_qs, mock_remove): super(RepoSyncConduitTests, self).setUp() mock_plugins.install() types_database.update_database([TYPE_1_DEF, TYPE_2_DEF]) self.association_manager = association_manager.RepoUnitAssociationManager() self.association_query_manager = association_query_manager.RepoUnitAssociationQueryManager() self.content_manager = content_manager.ContentManager() self.query_manager = query_manager.ContentQueryManager() self.conduit = RepoSyncConduit('repo-1', 'test-importer', 'abc123') importer_controller.set_importer('repo-1', 'mock-importer', {})
def setUp(self): super(RepoSyncConduitTests, self).setUp() mock_plugins.install() types_database.update_database([TYPE_1_DEF, TYPE_2_DEF]) self.repo_manager = repo_manager.RepoManager() self.importer_manager = importer_manager.RepoImporterManager() self.sync_manager = sync_manager.RepoSyncManager() self.association_manager = association_manager.RepoUnitAssociationManager() self.association_query_manager = association_query_manager.RepoUnitAssociationQueryManager() self.content_manager = content_manager.ContentManager() self.query_manager = query_manager.ContentQueryManager() self.repo_manager.create_repo('repo-1') self.importer_manager.set_importer('repo-1', 'mock-importer', {}) self.conduit = RepoSyncConduit('repo-1', 'test-importer', 'importer', 'importer-id')
def setUp(self): super(TestUnitsFromCriteria, self).setUp() self.manager = association_manager.RepoUnitAssociationManager() self.repo = me_model.Repository(repo_id='repo1')