def test_check_or_fail_succeed(self): '''Check that check_or_fail succeeds properly. ''' try: databases.check_or_fail(self.handler) except SystemExit: assert False, 'Should not have exited'
def test_check_or_fail_fail(self, tmpdir): config = self.config.copy() config['database_dir'] = str(tmpdir) handler = databases.get_handler(config) databases.build_default_pipeline(handler, config, self.databases, with_uniref=False) with pytest.raises(SystemExit): databases.check_or_fail(handler)
def handle_databases(self): log.start_logging() print(ui.header('submodule: databases', level=2)) handler = databases.get_handler(self.config_d) if self.args.quick: databases.build_quick_pipeline(handler, self.config_d, self.databases_d) else: databases.build_default_pipeline(handler, self.config_d, self.databases_d, with_uniref=self.args.full, with_nr=self.args.nr) if self.args.install: return databases.install(handler) else: databases.check_or_fail(handler)
def handle_annotate(self): log.start_logging() print(ui.header('submodule: annotate', level=2)) db_handler = databases.get_handler(self.config_d) if self.args.quick: databases.build_quick_pipeline(db_handler, self.config_d, self.databases_d) else: databases.build_default_pipeline(db_handler, self.config_d, self.databases_d, with_uniref=self.args.full, with_nr=self.args.nr) if self.config_d['force'] is True: utd_msg = '*All database tasks up-to-date.*' ood_msg = '*Some database tasks out-of-date; '\ 'FORCE is True, ignoring!' uptodate, statuses = db_handler.print_statuses( uptodate_msg=utd_msg, outofdate_msg=ood_msg) else: databases.check_or_fail(db_handler) annotate_handler = annotate.get_handler(self.config_d, db_handler.files) if self.args.quick: build_quick_pipeline(annotate_handler, self.config_d, db_handler.files) elif self.args.full: build_full_pipeline(annotate_handler, self.config_d, db_handler.files) elif self.args.nr: build_nr_pipeline(annotate_handler, self.config_d, db_handler.files) else: build_default_pipeline(annotate_handler, self.config_d, db_handler.files) return annotate.run_annotation(annotate_handler)