def test_is_adn():
    # Example d'un test; ajoutez des autres tests
    test(bioinfo.is_adn(short_adn) == True)
    test(bioinfo.is_adn(long_adn) == True)
    test(bioinfo.is_adn(invalid_adn) == False)
    test(bioinfo.is_adn('atx') == False)
    test(bioinfo.is_adn('atg') == True)
Esempio n. 2
0
def test_is_adn():
    """
    pre: module bioinfo
    post: test la fonction is_adn()
    """
    test(bioinfo.is_adn('atx') == False)
    test(bioinfo.is_adn('atg') == True)
    test(bioinfo.is_adn('axg') == False)
    test(bioinfo.is_adn('ATG') == True)
Esempio n. 3
0
def test_is_adn():
    test(bioinfo.is_adn("actxdf") is False)
    test(bioinfo.is_adn("agtact") is True)
Esempio n. 4
0
def test_is_adn():
    """Run the sequence of DNA and returns true if it only contains "a,c,t,g" and false in any other case
    """
    test(bioinfo.is_adn(short_adn) == True)
    test(bioinfo.is_adn(invalid_adn) == False)
    test(bioinfo.is_adn("atcg") == True)
    test(bioinfo.is_adn("ttcg") == True)
    test(bioinfo.is_adn("atgg") == True)
    test(bioinfo.is_adn("atcc") == True)
    test(bioinfo.is_adn("ACTG") == True)
    test(bioinfo.is_adn("CCTG") == True)
    test(bioinfo.is_adn("ACCG") == True)
    test(bioinfo.is_adn("ACTT") == True)
    test(bioinfo.is_adn("xtcg") == False)
    test(bioinfo.is_adn("atxg") == False)
    test(bioinfo.is_adn("atcx") == False)
    test(bioinfo.is_adn("XTCG") == False)
    test(bioinfo.is_adn("ATXG") == False)
    test(bioinfo.is_adn("ATCX") == False)
Esempio n. 5
0
def test_distance_h():
    test(bioinfo.distance_h("AA", "AA") == 0)
    test(bioinfo.distance_h("ACTG", "AATG") == 1)
    test(bioinfo.distance_h("ACTG", "ACGD") == 2)
    test(bioinfo.distance_h("ATCG", "ATTCG") == None)


def test_inverse():
    test(bioinfo.inverse("A") == "A")
    test(bioinfo.inverse("ATCG") == "GCTA")


def test_plus_long_palindrome():
    test(bioinfo.plus_long_palindrome("AXVG") == "A")
    test(bioinfo.plus_long_palindrome("ACCTGTTAGGATTC") == "TTAGGATT")
    test(bioinfo.plus_long_palindrome("") == None)
    test(bioinfo.plus_long_palindrome(palindrome1) == palindrome1)
    test(
        bioinfo.plus_long_palindrome("ACTGGTGC" + palindrome2 +
                                     "TTGC") == palindrome2)


test_is_adn()
test_positions()
test_distance_h()
test_inverse()
test_plus_long_palindrome()

bioinfo.is_adn(long_adn)