Files
firefox/third_party/python/rsa/tests/test_strings.py
T
Andrew Halberstadt 7bb38413f2 Bug 1346025 - Move vendored python modules from /python to /third_party/python, r=ted
This commit is a simple 'hg mv' and does not contain any file modifications.

***
Bug 1346025 - Split vendored modules in python/moz.build to third_party/python/moz.build, r=ted

***
Bug 1346025 - Update references to moved python modules, r=ted

MozReview-Commit-ID: A12RnIFtXju
2017-05-25 11:48:03 -04:00

29 lines
615 B
Python

'''Tests string operations.'''
from __future__ import absolute_import
import unittest2
import rsa
from constants import unicode_string
class StringTest(unittest2.TestCase):
def setUp(self):
(self.pub, self.priv) = rsa.newkeys(384)
def test_enc_dec(self):
message = unicode_string.encode('utf-8')
print("\tMessage: %s" % message)
encrypted = rsa.encrypt(message, self.pub)
print("\tEncrypted: %s" % encrypted)
decrypted = rsa.decrypt(encrypted, self.priv)
print("\tDecrypted: %s" % decrypted)
self.assertEqual(message, decrypted)