Beispiel #1
0
def test_decryption():
    """
    Do decryption and test the result
    """
    expected = "This is python course"
    actual = decrypt('Ymnx nx u~ymts htzwxj', 5)
    assert expected == actual
def test_decrypt():
    actual = decrypt(4, encrypted)
    expected = 'NEBIYU'
    assert actual == expected


# def test_lower():
#     actual = encrypt(4, message)
#     expected = 'rifmcy'
#     assert actual == expected

# if __name__== '__main__':
# message = 'nebiyu'
# encrypted = encrypt(4, message)
# print(encrypted)

# decrypted = decrypt(4,encrypted)
# print(decrypted)
# pass
Beispiel #3
0
def test_decrypt():
    assert decrypt('ybpq lc qfjbp', 732) == 'best of times'
Beispiel #4
0
def test_decrypt_upper_lower_nonAlpha():
    actual = decrypt("FdwV & GrjV!@%", 3)
    expected = "CatS & DogS!@%"
    assert actual == expected
Beispiel #5
0
def test_decrypt_upper_and_lower_case():
    actual = decrypt("FdwV", 3)
    expected = "CatS"
    assert actual == expected
Beispiel #6
0
def test_decrypt_with_key_lower():
    actual = decrypt("fdwv", 3)
    expected = "cats"
    assert actual == expected
Beispiel #7
0
def test_decrypt_shift_raise_string_valueerror():
    with pytest.raises(ValueError):
        assert decrypt(4, 3)
Beispiel #8
0
def test_decrypt():
    actual = decrypt("cat is animal ! hsdfo # rr5",500)
    expected = "igz oy gtosgr   nyjlu   xx "
    assert actual == expected
def test_decrpyt_multAlpha_bigShift():
    key = 25
    plain = 'zab'
    actual = decrypt(plain, key)
    expected = 'abc'
    assert actual == expected
Beispiel #10
0
def test_decrypt():
    tester = encrypt(test, key)
    actual = decrypt(tester, key)
    expected = "Ravenala"
    assert actual == expected
Beispiel #11
0
def test_decrypt_passes():
    expected = "Python is sneaky"
    actual = decrypt("Udymts nx xsjfpd", 5)
    assert actual == expected
def test_decrypt_function():
    actual=decrypt('b!cd',1)
    expected='abc'
    assert actual==expected
def test_decrypt_string():
    actual = decrypt('cde', 2)
    expected = 'abc'
    assert actual == expected
def test_decrpyt_oneAlpha_smallShift():
    key = 1
    plain = 'b'
    actual = decrypt(plain, key)
    expected = 'a'
    assert actual == expected
def test_decrypt_shift_4():
    actual = decrypt('Lipps Asvph', 4)
    expected = 'Hello World'
    assert actual == expected
def test_decrpyt_multAlpha_medShift():
    key = 12
    plain = 'mno'
    actual = decrypt(plain, key)
    expected = 'abc'
    assert actual == expected
Beispiel #17
0
def test_decrypt_shift_raise_integer_valueerror():
    with pytest.raises(ValueError):
        assert decrypt("hi", "hi")
def test_decrpyt_multAlpha_Upper():
    key = 25
    plain = 'AbCdEf'
    actual = decrypt(plain, key)
    expected = 'BcDeFg'
    assert actual == expected
Beispiel #19
0
def test_decrypte():
    actual = decrypt('NPMMAZ BCD', 1)
    expected = 'MOLLZY ABC'
    assert expected == actual