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