def test_read_mash_dist():
    mash.dist('tests/dummy_fastq/*fastq',
              output_file='tests/distances.tab',
              returncmd=True)
    results = mash.read_mash_output('tests/distances.tab')
    assert results[1].reference == 'tests/dummy_fastq/single.fastq' \
        and results[1].query == 'tests/dummy_fastq/test_R2.fastq' \
        and results[1].distance == 0.00763536
    os.remove('tests/distances.tab')
def test_mash_dist_call_multithreaded():
    out, err, cmd = mash.dist('tests/dummy_fastq/*fastq',
                              output_file='tests/distances.tab',
                              returncmd=True,
                              threads=4)
    assert cmd == 'mash dist tests/dummy_fastq/*fastq  -p 4  > tests/distances.tab'
    os.remove('tests/distances.tab')
def test_mash_dist_call_kwargs():
    out, err, cmd = mash.dist('tests/dummy_fastq/*fastq',
                              output_file='tests/distances.tab',
                              returncmd=True,
                              s='34')
    assert cmd == 'mash dist tests/dummy_fastq/*fastq  -p 1  -s 34 > tests/distances.tab'
    os.remove('tests/distances.tab')
def test_dist_no_input_files():
    with pytest.raises(ValueError):
        mash.dist()