示例#1
0
文件: steps.py 项目: beav/pulp_ostree
 def __init__(self, **kwargs):
     super(Main, self).__init__(
         step_type=constants.IMPORT_STEP_MAIN,
         plugin_type=constants.WEB_IMPORTER_TYPE_ID,
         **kwargs
     )
     self.feed_url = self.config.get(importer_constants.KEY_FEED)
     self.branches = self.config.get(constants.IMPORTER_CONFIG_KEY_BRANCHES, [])
     self.remote_id = model.generate_remote_id(self.feed_url)
     self.storage_path = os.path.join(
         constants.SHARED_STORAGE, self.remote_id, constants.CONTENT_DIR)
     self.add_child(Create())
     self.add_child(Pull())
     self.add_child(Add())
示例#2
0
 def __init__(self, **kwargs):
     super(Main, self).__init__(
         step_type=constants.IMPORT_STEP_MAIN,
         plugin_type=constants.WEB_IMPORTER_TYPE_ID,
         **kwargs
     )
     self.feed_url = self.config.get(importer_constants.KEY_FEED)
     self.branches = self.config.get(constants.IMPORTER_CONFIG_KEY_BRANCHES, [])
     self.remote_id = model.generate_remote_id(self.feed_url)
     self.storage_path = os.path.join(
         constants.SHARED_STORAGE, self.remote_id, constants.CONTENT_DIR)
     self.add_child(Create())
     self.add_child(Pull())
     self.add_child(Add())
示例#3
0
 def test_generate_remote_id(self):
     url = 'url-test'
     remote_id = generate_remote_id(url)
     h = sha256()
     h.update(url)
     self.assertEqual(remote_id, h.hexdigest())
示例#4
0
 def test_generate_remote_id(self):
     url = 'url-test'
     remote_id = generate_remote_id(url)
     h = sha256()
     h.update(url)
     self.assertEqual(remote_id, h.hexdigest())