'The serial number of an :py:obj:`X509Type` can be retrieved and modified with
:py:obj:`X509Type.get_serial_number` and :py:obj:`X509Type.set_serial_number`.'

def test_serial_number(self):

    certificate = X509()
    self.assertRaises(TypeError, certificate.set_serial_number)
    self.assertRaises(TypeError, certificate.set_serial_number, 1, 2)
    self.assertRaises(TypeError, certificate.set_serial_number, '1')
    self.assertRaises(TypeError, certificate.set_serial_number, 5.5)
    self.assertEqual(certificate.get_serial_number(), 0)
    certificate.set_serial_number(1)
    self.assertEqual(certificate.get_serial_number(), 1)
    certificate.set_serial_number(((2 ** 32) + 1))
    self.assertEqual(certificate.get_serial_number(), ((2 ** 32) + 1))
    certificate.set_serial_number(((2 ** 64) + 1))
    self.assertEqual(certificate.get_serial_number(), ((2 ** 64) + 1))
    certificate.set_serial_number(((2 ** 128) + 1))
    self.assertEqual(certificate.get_serial_number(), ((2 ** 128) + 1))
