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