1from __future__ import print_function, division, absolute_import
2from fontTools.misc.py23 import *
3from fontTools.misc.eexec import decrypt, encrypt
4
5
6def test_decrypt():
7    testStr = b"\0\0asdadads asds\265"
8    decryptedStr, R = decrypt(testStr, 12321)
9    assert decryptedStr == b'0d\nh\x15\xe8\xc4\xb2\x15\x1d\x108\x1a<6\xa1'
10    assert R == 36142
11
12
13def test_encrypt():
14    testStr = b'0d\nh\x15\xe8\xc4\xb2\x15\x1d\x108\x1a<6\xa1'
15    encryptedStr, R = encrypt(testStr, 12321)
16    assert encryptedStr == b"\0\0asdadads asds\265"
17    assert R == 36142
18