示例#1
0
    def test_x509_cert_der_to_pem_pem_to_der_ok_3(self) -> None:
        cert_der_bytes = utils.read_test_file_bytes(
            'test_data/sii-crypto/prueba-sii-cert.der')
        cert_pem_bytes = utils.read_test_file_bytes(
            'test_data/sii-crypto/prueba-sii-cert.pem')

        # note: we test the function with a double call because the input PEM data
        #   may have different line lengths and different line separators.
        self.assertEqual(
            x509_cert_pem_to_der(x509_cert_der_to_pem(cert_der_bytes)),
            x509_cert_pem_to_der(cert_pem_bytes))
示例#2
0
 def test_x509_cert_der_to_pem_type_error(self) -> None:
     with self.assertRaises(TypeError) as cm:
         x509_cert_der_to_pem(1)
     self.assertEqual(cm.exception.args, ("Value must be bytes.", ))