Example #1
0
    def run_test_harvest(self):
        # Determine the source
        if len(self.args) >= 2:
            source_id_or_name = unicode(self.args[1])
        else:
            print("Please provide a source id")
            sys.exit(1)

        utils.run_test_harvester(source_id_or_name)
Example #2
0
def run_test(ctx, id):
    """Runs a harvest - for testing only.

    This does all the stages of the harvest (creates job, gather,
    fetch, import) without involving the web UI or the queue
    backends. This is useful for testing a harvester without having to
    fire up gather/fetch_consumer processes, as is done in production.

    """
    flask_app = ctx.meta["flask_app"]
    with flask_app.test_request_context():
        utils.run_test_harvester(id)
Example #3
0
    def run_test_harvest(self):
        # Determine the source
        force_import = None
        if len(self.args) >= 2:
            if len(self.args) >= 3 and self.args[2].startswith('force-import='):
                force_import = self.args[2].split('=')[-1]
            source_id_or_name = six.text_type(self.args[1])
        else:
            print("Please provide a source id")
            sys.exit(1)

        utils.run_test_harvester(source_id_or_name, force_import)