Ejemplo n.º 1
0
def test_func_negative():
    """Test negative cases"""
    nose.tools.assert_equals(longest_pal(''), '0')
    nose.tools.assert_equals(
        longest_pal(
            '12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901'
        ), 'String should not be longer than 100 characters.')
Ejemplo n.º 2
0
def test_func():
    """Test for positive results"""
    nose.tools.assert_equals(
        longest_pal(
            '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'
        ), '1')
    nose.tools.assert_equals(longest_pal('1234567890'), '1')
    nose.tools.assert_equals(longest_pal('0'), '1')
    nose.tools.assert_equals(longest_pal('banana'), '5')
    nose.tools.assert_equals(longest_pal('-5-5-5'), '5')
    nose.tools.assert_equals(longest_pal('try this one'), '1')
Ejemplo n.º 3
0
def test_func():
    """Test with given input"""
    assert longest_pal("Test sequence qwqwq") == "5"
Ejemplo n.º 4
0
def test_fibo(inputs, palindrom_length):
    """Test with different inputs."""
    assert longest_pal(inputs) == palindrom_length
Ejemplo n.º 5
0
def test_errors(inputs, ouputs):
    """Test of raising exceptions."""
    assert longest_pal(inputs) == ouputs