Example #1
0
def test_2_genotype_breeding_1():
    mg1 = MultiGenotype(G('Aa'), G('Bb'))
    mg2 = MultiGenotype(G('Aa'), G('Bb'))
    assert mg1.breed(mg2) == [
        'AABB', 'AABb', 'AaBB', 'AaBb', 'AAbB', 'AAbb', 'AabB', 'Aabb', 'aABB',
        'aABb', 'aaBB', 'aaBb', 'aAbB', 'aAbb', 'aabB', 'aabb'
    ]
Example #2
0
def test_2_genotype_breeding_2():
    mg1 = MultiGenotype(G('ff'), G('cC'))
    mg2 = MultiGenotype(G('fF'), G('cc'))
    assert mg1.breed(mg2) == [
        'ffcc',
        'ffcc',
        'fFcc',
        'fFcc',
        'ffCc',
        'ffCc',
        'fFCc',
        'fFCc',
        'ffcc',
        'ffcc',
        'fFcc',
        'fFcc',
        'ffCc',
        'ffCc',
        'fFCc',
        'fFCc',
    ]
Example #3
0
def test_misshapen_multi_genotypes():
    mg1 = MultiGenotype(G('kK'), G('Ll'))
    mg2 = MultiGenotype(G('kk'), G('ll'), G('cC'))
    with pytest.raises(ValueError):
        mg1.breed(mg2)
Example #4
0
def test_2_genotypes():
    assert str(MultiGenotype(G('Aa'), G('cc'))) == 'Aacc'
Example #5
0
def test_incompatible_multi_genotypes():
    mg1 = MultiGenotype(G('kK'), G('yY'))
    mg2 = MultiGenotype(G('kk'), G('sS'))
    with pytest.raises(ValueError):
        mg1.breed(mg2)
Example #6
0
def test_no_duplicate_genotype_classes():
    with pytest.raises(ValueError):
        MultiGenotype(G('Zz'), G('ZZ'))
Example #7
0
def test_equality_2():
    assert MultiGenotype(G('bb'), G('cc')) != MultiGenotype(G('BB'), G('CC'))
Example #8
0
def test_equality_1():
    assert MultiGenotype(G('ll'), G('Aa')) == MultiGenotype(G('ll'), G('Aa'))
Example #9
0
def test_wrong_args():
    with pytest.raises(ValueError):
        MultiGenotype(G('Cc'), 42)
Example #10
0
def test_3_genotypes():
    assert str(MultiGenotype(G('kK'), G('FF'), G('Rr'))) == 'kKFFRr'
Example #11
0
from table_gen import create_multi_gene_table
from gene_convenience import create_genotype as g
from gene import MultiGenotype

MGenotype1 = MultiGenotype(g("Aa"), g("Bb"))
MGenotype2 = MultiGenotype(g("Aa"), g("Bb"))

create_multi_gene_table(MGenotype1, MGenotype2)