Exemplo n.º 1
0
def test_invalid_types(invalid_input):
    '''Invalid parameter types should raise TypeError'''
    with pytest.raises(TypeError):
        mycrypt.encode(invalid_input)
Exemplo n.º 2
0
def test_encode_decode(test_input):
    '''Verify that decoding an encoded string returns original string'''
    assert(mycrypt.decode(mycrypt.encode(test_input))) == test_input
Exemplo n.º 3
0
def test_invalid_char(invalid_input):
    '''Invalid characters should result in ValueError'''
    with pytest.raises(ValueError):
        mycrypt.encode(invalid_input)
Exemplo n.º 4
0
def test_invalid_types(invalid_input):
    '''Invalid parameter types should raise TypeError'''
    with pytest.raises(TypeError):
        mycrypt.encode(invalid_input)
Exemplo n.º 5
0
def test_encode(test_input, expected):
    '''Verify that strings given above match the expected results'''
    assert(mycrypt.encode(test_input)) == expected
Exemplo n.º 6
0
def test_invalid_char(invalid_input):
    '''Invalid characters should result in ValueError'''
    with pytest.raises(ValueError):
        mycrypt.encode(invalid_input)
Exemplo n.º 7
0
def test_encode_decode(test_input):
    '''Verify that decoding an encoded string returns original string'''
    assert(mycrypt.decode(mycrypt.encode(test_input))) == test_input
Exemplo n.º 8
0
def test_encode(test_input, expected):
    '''Verify that strings given above match the expected results'''
    assert(mycrypt.encode(test_input)) == expected
Exemplo n.º 9
0
def test_invalid_char2(invalid_input):
    '''Testing that too long inputs wont make it'''
    with pytest.raises(ValueError):
        mycrypt.encode(invalid_input)
Exemplo n.º 10
0
def test_invalid_length(invalid_input):
    '''Invalid parameter length should raise ValueError'''
    with pytest.raises(ValueError):
        mycrypt.encode(invalid_input)