'Confirm we can set and get serial numbers from
:py:obj:`OpenSSL.crypto.Revoked`.  Confirm errors are handled
with grace.'

def test_serial(self):

    revoked = Revoked()
    ret = revoked.set_serial(b('10b'))
    self.assertEquals(ret, None)
    ser = revoked.get_serial()
    self.assertEquals(ser, b('010B'))
    revoked.set_serial(b('31ppp'))
    ser = revoked.get_serial()
    self.assertEquals(ser, b('31'))
    self.assertRaises(ValueError, revoked.set_serial, b('pqrst'))
    self.assertRaises(TypeError, revoked.set_serial, 100)
    self.assertRaises(TypeError, revoked.get_serial, 1)
    self.assertRaises(TypeError, revoked.get_serial, None)
    self.assertRaises(TypeError, revoked.get_serial, '')
