コード例 #1
0
def test_n_neg():
    """Perform unit tests on test-driven_dev.n_neg."""

    assert test_driven_dev.n_neg('E') == 1
    assert test_driven_dev.n_neg('D') == 1
    assert test_driven_dev.n_neg('') == 0
    assert test_driven_dev.n_neg('ACKLWTTAE') == 1
    assert test_driven_dev.n_neg('DDDDEEEE') == 8
    assert test_driven_dev.n_neg('acklwttae') == 1
コード例 #2
0
def test_n_neg_for_invalid_amino_acid():
    with pytest.raises(RuntimeError) as excinfo:
        test_driven_dev.n_neg('Z')
    excinfo.match("Z is not a valid amino acid")
コード例 #3
0
def test_n_neg_for_lower_case_sequences():
    assert test_driven_dev.n_neg('acklwttae') == 1
コード例 #4
0
def test_n_neg_for_longer_sequences():
    assert test_driven_dev.n_neg('ACKLWTTAE') == 1
    assert test_driven_dev.n_neg('DDDDEEEE') == 8
コード例 #5
0
def test_n_neg_for_empty_sequence():
    assert test_driven_dev.n_neg('') == 0
コード例 #6
0
def test_n_neg_for_single_E_or_D():
    """Perform unit tests on n_neg."""

    assert test_driven_dev.n_neg('E') == 1
    assert test_driven_dev.n_neg('D') == 1