fix
diff --git a/OpenSSL/crypto.py b/OpenSSL/crypto.py
index 60b2c9b..74ebc24 100644
--- a/OpenSSL/crypto.py
+++ b/OpenSSL/crypto.py
@@ -1615,7 +1615,7 @@
             "type argument must be FILETYPE_PEM, FILETYPE_ASN1, or "
             "FILETYPE_TEXT")
 
-    assert result_code == 0
+    assert result_code == 1
     return _bio_to_string(bio)