def test_setup_fail(): with patch.object(SetupAMR, "__init__", lambda x: None): amr_obj = SetupAMR() amr_obj.contigs = f"{test_folder / 'batch_fail.txt'}" amr_obj.prefix = '' amr_obj.jobs = 16 amr_obj.species = '' amr_obj.logger = logging.getLogger(__name__) T = collections.namedtuple( 'T', ['run_type', 'input', 'prefix', 'jobs', 'organism']) input_data = T('batch', amr_obj.contigs, amr_obj.prefix, amr_obj.jobs, amr_obj.species) with pytest.raises(SystemExit): amr_obj.setup()
def run_pipeline(args): P = SetupAMR(args) input_data = P.setup() A = RunFinder(input_data) amr_data = A.run() C = Collate(amr_data) collated_data = C.run()
def test_setup_contigs(): with patch.object(SetupAMR, "__init__", lambda x: None): amr_obj = SetupAMR() amr_obj.contigs = f"{test_folder / 'contigs.fa'}" amr_obj.prefix = 'somename' amr_obj.jobs = 16 amr_obj.species = '' amr_obj.identity = '' amr_obj.logger = logging.getLogger(__name__) T = collections.namedtuple( 'T', ['run_type', 'input', 'prefix', 'jobs', 'organism', 'identity']) input_data = T('assembly', amr_obj.contigs, amr_obj.prefix, amr_obj.jobs, amr_obj.species, amr_obj.identity) assert amr_obj.setup() == input_data