コード例 #1
0
ファイル: test_mycrypt.py プロジェクト: seng-2021/lab-OMP404
def test_invalid_types(invalid_input):
    '''Invalid parameter types should raise TypeError'''
    with pytest.raises(TypeError):
        mycrypt.encode(invalid_input)
コード例 #2
0
ファイル: test_mycrypt.py プロジェクト: seng-2021/lab-OMP404
def test_encode_decode(test_input):
    '''Verify that decoding an encoded string returns original string'''
    assert(mycrypt.decode(mycrypt.encode(test_input))) == test_input
コード例 #3
0
ファイル: test_mycrypt.py プロジェクト: seng-2021/lab-OMP404
def test_invalid_char(invalid_input):
    '''Invalid characters should result in ValueError'''
    with pytest.raises(ValueError):
        mycrypt.encode(invalid_input)
コード例 #4
0
def test_invalid_types(invalid_input):
    '''Invalid parameter types should raise TypeError'''
    with pytest.raises(TypeError):
        mycrypt.encode(invalid_input)
コード例 #5
0
ファイル: test_mycrypt.py プロジェクト: seng-2021/lab-OMP404
def test_encode(test_input, expected):
    '''Verify that strings given above match the expected results'''
    assert(mycrypt.encode(test_input)) == expected
コード例 #6
0
def test_invalid_char(invalid_input):
    '''Invalid characters should result in ValueError'''
    with pytest.raises(ValueError):
        mycrypt.encode(invalid_input)
コード例 #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
コード例 #8
0
def test_encode(test_input, expected):
    '''Verify that strings given above match the expected results'''
    assert(mycrypt.encode(test_input)) == expected
コード例 #9
0
def test_invalid_char2(invalid_input):
    '''Testing that too long inputs wont make it'''
    with pytest.raises(ValueError):
        mycrypt.encode(invalid_input)
コード例 #10
0
def test_invalid_length(invalid_input):
    '''Invalid parameter length should raise ValueError'''
    with pytest.raises(ValueError):
        mycrypt.encode(invalid_input)