@@ -0,0 +1,1715 @@
+import pytest%0Afrom locuspocus import Locus,RefLoci,Term%0Afrom locuspocus.Exceptions import *%0Aimport minus80 as m80%0Afrom dataclasses import FrozenInstanceError%0A%0A@pytest.fixture%0Adef t():%0A    a = Locus('1',1,100)%0A    b = Locus('2',200,300)%0A    c = Locus('3',300,400)%0A    t = Term(%0A        'test',%0A        desc='test term',%0A        loci = %5Ba,b,c%5D,%0A        attrs = %7B%0A            'foo' : 'bar',%0A            'baz' : 'bat'%0A        %7D%0A    )%0A    return t%0A%0Adef test_term_init(t):%0A    assert t%0A%0Adef test_term_name(t):%0A    assert t.name == 'test'%0A%0Adef test_term_desc(t):%0A    assert t.desc == 'test term'%0A%0Adef test_term_loci(t):%0A    for l in t.loci:%0A        assert isinstance(l,Locus)%0A        %0Adef test_term_attrs(t):%0A    assert t.attrs%5B'foo'%5D == 'bar'%0A    assert t.attrs%5B'baz'%5D == 'bat'%0A%0Adef test_no_parent(t):%0A    assert t.parent is None%0A%0Adef test_frozen(t):%0A    assert t._frozen == True%0A%0Adef test_len(t):%0A    assert len(t) == 3%0A%0Adef test_getitem(t):%0A    assert t%5B'foo'%5D == 'bar'%0A    assert t%5B'baz'%5D == 'bat'%0A%0Adef test_setitem_frozen(t):%0A    with pytest.raises(FrozenInstanceError):%0A        # throws an error since Terms are frozen%0A        t%5B'fizz'%5D = 'wizz'%0A%0Adef test_add_locus():%0A    t = Term('test')%0A    assert len(t) == 0%0A    t.add_locus(Locus('1',1,100))%0A    assert len(t) == 1%0A%0Adef test_add_duplicate_locus():%0A    t = Term('test')%0A    assert len(t) == 0%0A    t.add_locus(Locus('1',1,100))%0A    assert len(t) == 1%0A    # Add duplicate which wont count%0A    t.add_locus(Locus('1',1,100))%0A    assert len(t) == 1%0A%0Adef test_nearby_loci(t):%0A    x = Locus('1',150,200)%0A    nearby = list(t.nearby_loci(x,max_distance=50))%0A    assert len(nearby) == 1%0A    nearby = list(t.nearby_loci(x,max_distance=10))%0A    assert len(nearby) == 0%0A    %0A

cut losses