Пример #1
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())
Пример #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())