def _add_x509_hex(obj): if isinstance(obj, list): for array_item in obj: _add_x509_hex(array_item) elif isinstance(obj, dict): try: if 'x509ThumbprintHex' not in obj: if obj['x509Thumbprint']: obj['x509ThumbprintHex'] = b64_to_hex(obj['x509Thumbprint']) except (KeyError, IndexError, TypeError): pass for item_key in obj: _add_x509_hex(obj[item_key])
def test_b64_to_hex_type(self): self.assertIsInstance(b64_to_hex(self.base64), str)
def test_b64_to_hex(self): self.assertEqual('3EF38981A3EAE51D34E06C93D6D074216DD75323', b64_to_hex(self.base64))
def test_b64_to_hex(self): self.assertEquals('3EF38981A3EAE51D34E06C93D6D074216DD75323', b64_to_hex(self.base64))