]> Cypherpunks.ru repositories - pyderasn.git/blobdiff - tests/test_cms.py
Fix example SignedAttributes bounds
[pyderasn.git] / tests / test_cms.py
index 51bdaf1cbf26adb3d2843d9481d8c36766032eb3..e9ccf2198c93cd0955a29209c5041e6b8674eb87 100644 (file)
@@ -83,7 +83,7 @@ class SignatureAlgorithmIdentifier(AlgorithmIdentifier):
 
 class SignedAttributes(SetOf):
     schema = Attribute()
-    bounds = (1, 32)
+    bounds = (1, float("+inf"))
     der_forced = True
 
 
@@ -294,6 +294,7 @@ class TestSignedDataCERWithOpenSSL(TestCase):
         buf = BytesIO()
         agg_octet_string(evgens, ("encapContentInfo", "eContent"), raw, buf.write)
         self.assertSequenceEqual(buf.getvalue(), data)
+        fd.close()
 
     def create_huge_file(self):
         rnd = urandom(1<<20)
@@ -382,6 +383,7 @@ class TestSignedDataCERWithOpenSSL(TestCase):
             ci.encode_cer(fd.write)
         print("CMS written", time() - start)
         self.verify(cert_path, cms_path)
+        eci_fd.close()
 
     @skipIf(PY2, "no mmaped memoryview support in PY2")
     @skipIf("PYDERASN_TEST_CMS_HUGE" not in environ, "PYDERASN_TEST_CMS_HUGE is not set")