def _init_publisher(self): repo = Repository(self.repo_id, working_dir=self.working_dir) self.repo = repo conduit = RepoPublishConduit(repo.id, YUM_DISTRIBUTOR_ID) conduit.last_publish = mock.Mock(return_value=None) conduit.get_repo_scratchpad = mock.Mock(return_value={}) config_defaults = {'http': True, 'https': True, 'relative_url': None, 'http_publish_dir': os.path.join(self.published_dir, 'http'), 'https_publish_dir': os.path.join(self.published_dir, 'https')} config = PluginCallConfiguration(None, None) config.default_config.update(config_defaults) self.publisher = publish.BaseYumRepoPublisher(repo, conduit, config, YUM_DISTRIBUTOR_ID, working_dir=self.working_dir) self.publisher.get_checksum_type = mock.Mock(return_value=None) # mock out the repomd_file_context, so _publish_<step> can be called # outside of the publish() method self.publisher.repomd_file_context = mock.MagicMock() self.publisher.all_steps = mock.MagicMock()
def setUp(self): self.working_directory = tempfile.mkdtemp() self.content_dir = os.path.join(self.working_directory, 'content') self.working_dir = os.path.join(self.working_directory, 'work') os.makedirs(self.working_dir) self.repo = Repository(id='foo', working_dir=self.working_dir) config = PluginCallConfiguration(None, None) conduit = RepoPublishConduit(self.repo.id, 'foo_repo') conduit.get_repo_scratchpad = Mock(return_value={u'tags': {}}) self.parent = steps.PluginStep('test-step', self.repo, conduit, config)
def setUp(self): self.working_directory = tempfile.mkdtemp() self.source_dir = os.path.join(self.working_directory, 'src') self.target_dir = os.path.join(self.working_directory, 'target') os.makedirs(self.source_dir) os.makedirs(self.target_dir) self.repo = Repository(id='foo', working_dir=self.target_dir) config = PluginCallConfiguration(None, None) conduit = RepoPublishConduit(self.repo.id, 'foo_repo') conduit.get_repo_scratchpad = Mock(return_value={}) self.parent = steps.PluginStep('test-step', self.repo, conduit, config)
def setUp(self): self.temp_dir = tempfile.mkdtemp() self.working_directory = os.path.join(self.temp_dir, 'working') self.publish_directory = os.path.join(self.temp_dir, 'publish') self.content_directory = os.path.join(self.temp_dir, 'content') os.makedirs(self.working_directory) os.makedirs(self.publish_directory) os.makedirs(self.content_directory) repo = Repository('foo_repo_id', working_dir=self.working_directory) config = PluginCallConfiguration(None, None) conduit = RepoPublishConduit(repo.id, 'foo_repo') conduit.get_repo_scratchpad = Mock(return_value={u'tags': {}}) self.parent = PublishStep('test-step', repo, conduit, config)
def _init_publisher(self): repo = Repository(self.repo_id, working_dir=self.working_dir) conduit = RepoPublishConduit(repo.id, YUM_DISTRIBUTOR_ID) conduit.get_repo_scratchpad = mock.Mock(return_value={}) config_defaults = { "http": True, "https": True, "relative_url": None, "http_publish_dir": os.path.join(self.published_dir, "http"), "https_publish_dir": os.path.join(self.published_dir, "https"), } config = PluginCallConfiguration(None, None) config.default_config.update(config_defaults) self.publisher = publish.Publisher(repo, conduit, config) # mock out the repomd_file_context, so _publish_<step> can be called # outside of the publish() method self.publisher.repomd_file_context = mock.MagicMock()