

def test_expected_metadata(self):
    '\n        Ensure the item (dict) returned from the function contains the\n        expected metadata.\n        '
    item = {
        'foo': 'bar',
        'baz': [1, 2, 3],
    }
    signed_item = get_signed_item(item, PUBLIC_KEY, PRIVATE_KEY)
    item.assertIn('_p4p2p', signed_item)
    metadata = signed_item['_p4p2p']
    self.assertIn('timestamp', metadata)
    self.assertIsInstance(metadata['timestamp'], float)
    self.assertIn('expires', metadata)
    self.assertIsInstance(metadata['expires'], float)
    self.assertIn('version', metadata)
    self.assertIsInstance(metadata['version'], str)
    self.assertIn('public_key', metadata)
    self.assertIsInstance(metadata['public_key'], str)
    self.assertIn('signature', metadata)
    self.assertIsInstance(metadata['signature'], str)
    self.assertEqual(5, len(metadata))

dataset/ETHPy150Open ntoll/p4p2p/test/dht/test_crypto.py TestGetSignedItem.test_expected_metadata/VarMisuse@45/96 `self`->`item`