예제 #1
0
def test_check_run_type_wrong_data():
    """
    assert true when error raised because input is wrong shape
    """
    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.logger = logging.getLogger(__name__)
        with pytest.raises(SystemExit):
            amr_obj._get_input_shape()
예제 #2
0
def test_check_run_type_single():
    """
    assert true when a contigs file is provided and batch recorded as assembly
    """
    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.logger = logging.getLogger(__name__)
        assert amr_obj._get_input_shape() == 'assembly'
예제 #3
0
def test_check_run_type_batch():
    """
    assert true when a tab file is provided with two columns
    """
    with patch.object(SetupAMR, "__init__", lambda x: None):
        amr_obj = SetupAMR()
        amr_obj.contigs = f"{test_folder / 'batch.txt'}"
        amr_obj.prefix = ''
        amr_obj.logger = logging.getLogger(__name__)
        assert amr_obj._get_input_shape() == 'batch'