Exemplo n.º 1
0
def test_reaction_from_text_catalog_num():
    rxn = Reaction.from_text("""\
            Reagent  Stock   Volume  MM?  Cat
            =======  =====  =======  ===  ===
            w               to 8 µL  yes
            x           2x     3 µL   no  101
    """)

    assert rxn['w'].catalog_num == ''
    assert rxn['x'].catalog_num == '101'
Exemplo n.º 2
0
def test_reaction_from_text_flags():
    rxn = Reaction.from_text("""\
            Reagent  Stock   Volume  MM?  Flags
            =======  =====  =======  ===  =====
            w               to 8 µL  yes  a
            x           2x     3 µL   no  a,b
    """)

    assert rxn['w'].flags == {'a'}
    assert rxn['x'].flags == {'a', 'b'}
Exemplo n.º 3
0
def test_reaction_from_text(text, volume, reagents):
    rxn = Reaction.from_text(text)

    assert len(rxn) == len(reagents)
    assert rxn.volume == volume

    for name, expected in reagents.items():
        volume, stock_conc, master_mix = expected
        if volume != ...:     assert rxn[name].volume == volume
        if stock_conc != ...: assert rxn[name].stock_conc == stock_conc
        if master_mix != ...: assert rxn[name].master_mix == master_mix
Exemplo n.º 4
0
def test_reaction_from_text_raises(text, err):
    with pytest.raises(UsageError, match=err):
        Reaction.from_text(text)