def test_two_read_queries():
    """
    Ensures that we can query correctly through an internal node
    and that changing theta works accordingly
    """
    bloom_tree = BloomTree(0.3, 3, 100000, 0.03)
    # note: have 1  3mer in common
    read_1 = Read('a.fastq', 'a', None, 'ABCDE', 'IIII')
    read_2 = Read('b.fastq', 'b', None, 'CDEFG', 'IIII')
    bloom_tree.insert([read_1])
    bloom_tree.insert([read_2])
    assert bloom_tree.query('AAAAA') == []
    assert bloom_tree.query('BCDEF') == ['a.fastq', 'b.fastq']
    assert bloom_tree.query('CDEFG') == ['a.fastq', 'b.fastq']
    assert bloom_tree.query('ABCDE') == ['a.fastq', 'b.fastq']
    bloom_tree.theta = 0.6
    assert bloom_tree.query('AAAAA') == []
    assert bloom_tree.query('BCDEF') == ['a.fastq', 'b.fastq']
    assert bloom_tree.query('CDEFG') == ['b.fastq']
    assert bloom_tree.query('ABCDE') == ['a.fastq']
    bloom_tree.theta = 0.9
    assert bloom_tree.query('AAAAA') == []
    assert bloom_tree.query('BCDEF') == []
    assert bloom_tree.query('CDEFG') == ['b.fastq']
    assert bloom_tree.query('ABCDE') == ['a.fastq']
def test_single_read_queries():
    """
    Ensures that we can query a single leaf/single node tree
    """
    bloom_tree = BloomTree(0.5, 3, 100000, 0.03)
    read_1 = Read('a.fastq', 'a', None, 'GCGT', 'IIII')
    bloom_tree.insert([read_1])
    assert bloom_tree.query('AAAA') == []
    assert bloom_tree.query('GCGT') == ['a.fastq']
    assert bloom_tree.query('ACGT') == ['a.fastq']
    assert bloom_tree.query('GCGA') == ['a.fastq']
    bloom_tree.theta = 0.6
    assert bloom_tree.query('AAAA') == []
    assert bloom_tree.query('GCGT') == ['a.fastq']
    assert bloom_tree.query('ACGT') == []
    assert bloom_tree.query('GCGA') == []