From a8f134ad60705830ccf53594599f902640d3a516 Mon Sep 17 00:00:00 2001 From: "C. Titus Brown" Date: Fri, 18 Aug 2023 18:16:23 -0700 Subject: [PATCH] add test for 'bug' - only one sketch loaded from each sigfile --- src/python/tests/test_gather.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/python/tests/test_gather.py b/src/python/tests/test_gather.py index 962e859b..75858ed6 100644 --- a/src/python/tests/test_gather.py +++ b/src/python/tests/test_gather.py @@ -198,3 +198,27 @@ def test_bad_against_2(runtmp, capfd): print(captured.err) # @CTB: should be some kind of error message here. + + +def test_against_multisigfile(runtmp): + # test against a sigfile that contains multiple sketches + query = get_test_data('SRR606249.sig.gz') + against_list = runtmp.output('against.txt') + + sig2 = get_test_data('2.fa.sig.gz') + sig47 = get_test_data('47.fa.sig.gz') + sig63 = get_test_data('63.fa.sig.gz') + + combined = runtmp.output('combined.sig.gz') + runtmp.sourmash('sig', 'cat', sig2, sig47, sig63, '-o', combined) + make_file_list(against_list, [combined]) + + g_output = runtmp.output('gather.csv') + p_output = runtmp.output('prefetch.csv') + + runtmp.sourmash('scripts', 'fastgather', query, against_list, + '-o', g_output, '--output-prefetch', p_output, + '-s', '100000') + df = pandas.read_csv(g_output) + assert len(df) == 1 + # @CTB this is a bug :(. It should load multiple sketches properly!