'Use python to create a simple CRL with two revocations.
Get back the :py:obj:`Revoked` using :py:obj:`OpenSSL.CRL.get_revoked` and
verify them.'

def test_get_revoked(self):

    crl = CRL()
    revoked = Revoked()
    now = b(datetime.now().strftime('%Y%m%d%H%M%SZ'))
    revoked.set_rev_date(now)
    revoked.set_serial(b('3ab'))
    crl.add_revoked(revoked)
    revoked.set_serial(b('100'))
    revoked.set_reason(b('sUpErSeDEd'))
    crl.add_revoked(revoked)
    revs = crl.get_revoked()
    self.assertEqual(len(revs), 2)
    self.assertEqual(type(revs[0]), Revoked)
    self.assertEqual(type(revs[1]), Revoked)
    self.assertEqual(revs[0].get_serial(), b('03AB'))
    self.assertEqual(revs[1].get_serial(), b('0100'))
    self.assertEqual(revs[0].get_rev_date(), now)
    self.assertEqual(revs[1].get_rev_date(), now)
