Example #1
0
def test_encode_long():
    #   https://www.lipsum.com
    test_str = 'LOREM IPSUM DOLOR SIT AMET CONSECTETUR ADIPISCING ELIT MAURIS AUGUE NISI SOLLICITUDIN ID SAGITTIS SED ' \
               'TRISTIQUE VEL IPSUM PROIN ALIQUAM LUCTUS MAURIS '
    assert cc.encode(
        test_str,
        3) == 'ORUHP LSVXP GRORU VLW DPHW FRQVHFWHWXU DGLSLVFLQJ HOLW PDXULV DXJXH QLVL VROOLFLWXGLQ LG VDJLWWLV VHG ' \
              'WULVWLTXH YHO LSVXP SURLQ DOLTXDP OXFWXV PDXULV '
Example #2
0
def test_encode():
    test_str = 'ABCDXYZ'
    assert cc.encode(test_str, 3) == 'DEFGABC'
Example #3
0
def test_empty_str_in():
    with pytest.raises(AssertionError):
        test_str = ''
        cc.encode(test_str, 3)
Example #4
0
def test_negative_stride():
    test_str = 'XYZABC'
    assert cc.encode(test_str, -3) == 'UVWXYZ'
Example #5
0
def test_encode_invalid_char():
    test_str = 'ab_34_$%'
    assert cc.encode(test_str, 3) == 'ab_34_$%'