]> Cypherpunks.ru repositories - pyderasn.git/blobdiff - tests/test_crl.py
mmap-ed memoryview support
[pyderasn.git] / tests / test_crl.py
index 317355213365e389c5d17f5bc3a31857df8e3dd2..70692303726d28af6bb5b38292c49f146dabf75b 100644 (file)
@@ -22,8 +22,11 @@ from time import time
 from unittest import skipIf
 from unittest import TestCase
 
+from six import PY2
+
 from pyderasn import BitString
 from pyderasn import encode_cer
+from pyderasn import file_mmaped
 from pyderasn import Sequence
 from pyderasn import SequenceOf
 from pyderasn import tag_ctxc
@@ -87,3 +90,10 @@ class TestCACert(TestCase):
         der_raw = crl2.encode()
         print("DER encoded", time() - start)
         self.assertSequenceEqual(der_raw, raw)
+
+    @skipIf(PY2, "Py27 mmap does not implement buffer protocol")
+    def test_mmaped(self):
+        fd = open("revoke.crl", "rb")
+        start = time()
+        CertificateList().decod(file_mmaped(fd))
+        print("DER decoded", time() - start)