summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorYesudeep Mangalapilly <yesudeep@gmail.com>2011-08-16 14:58:32 +0530
committerYesudeep Mangalapilly <yesudeep@gmail.com>2011-08-16 14:58:32 +0530
commit5bfe5ffea25ee7aacaa48db55ed429b31714afb0 (patch)
tree133988336aaefb98b008dbaafab17a370c9b87f9 /tests
parentd1060d36697efcd1179ffdbc7b16d3a68643b8c5 (diff)
downloadrsa-git-5bfe5ffea25ee7aacaa48db55ed429b31714afb0.tar.gz
Moves incompatible doctests to unit test modules.
Diffstat (limited to 'tests')
-rw-r--r--tests/test__version200.py12
-rw-r--r--tests/test_pem.py14
2 files changed, 26 insertions, 0 deletions
diff --git a/tests/test__version200.py b/tests/test__version200.py
new file mode 100644
index 0000000..2a179a8
--- /dev/null
+++ b/tests/test__version200.py
@@ -0,0 +1,12 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+import unittest2
+from rsa._compat import b
+
+from rsa._version200 import int2bytes, bytes2int
+
+class Test_int2bytes(unittest2.TestCase):
+ def test_values(self):
+ self.assertEqual(int2bytes(123456789), b('\x07[\xcd\x15'))
+ self.assertEqual(bytes2int(int2bytes(123456789)), 123456789)
diff --git a/tests/test_pem.py b/tests/test_pem.py
new file mode 100644
index 0000000..867f678
--- /dev/null
+++ b/tests/test_pem.py
@@ -0,0 +1,14 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+
+import unittest2
+from rsa._compat import b
+from rsa.pem import _markers
+
+
+class Test__markers(unittest2.TestCase):
+ def test_values(self):
+ self.assertEqual(_markers('RSA PRIVATE KEY'),
+ (b('-----BEGIN RSA PRIVATE KEY-----'),
+ b('-----END RSA PRIVATE KEY-----')))