def testDecode1(self): # Empty sequence der = DerOctetString() der.decode(b('\x04\x00')) self.assertEqual(der.payload, b('')) # Small payload der.decode(b('\x04\x02\x01\x02')) self.assertEqual(der.payload, b('\x01\x02'))
def testDecode2(self): # Verify that decode returns the object der = DerOctetString() self.assertEqual(der, der.decode(b('\x04\x00')))