def test_write_with_args(self): stream = utils.BytearrayStream() payload = payloads.CreateKeyPairResponsePayload( self.private_key_uuid, self.public_key_uuid, self.private_key_template_attribute, self.public_key_template_attribute) self._test_write(stream, payload, self.encoding_full)
def test_process_create_key_pair_batch_item(self): batch_item = ResponseBatchItem( operation=Operation(OperationEnum.CREATE_KEY_PAIR), response_payload=payloads.CreateKeyPairResponsePayload()) result = self.client._process_create_key_pair_batch_item(batch_item) msg = "expected {0}, received {1}".format(CreateKeyPairResult, result) self.assertIsInstance(result, CreateKeyPairResult, msg)
def test_read_with_args(self): stream = self.encoding_full payload = payloads.CreateKeyPairResponsePayload( self.private_key_uuid, self.public_key_uuid, self.private_key_template_attribute, self.public_key_template_attribute) self._test_read(stream, payload, self.private_key_uuid, self.public_key_uuid, self.private_key_template_attribute, self.public_key_template_attribute)
def test_process_batch_items(self): batch_item = ResponseBatchItem( operation=Operation(OperationEnum.CREATE_KEY_PAIR), response_payload=payloads.CreateKeyPairResponsePayload()) response = ResponseMessage(batch_items=[batch_item, batch_item]) results = self.client._process_batch_items(response) base = "expected {0}, received {1}" msg = base.format(list, results) self.assertIsInstance(results, list, msg) msg = "number of results " + base.format(2, len(results)) self.assertEqual(2, len(results), msg) for result in results: msg = base.format(CreateKeyPairResult, result) self.assertIsInstance(result, CreateKeyPairResult, msg)
def _create_create_key_pair_payload(self): return payloads.CreateKeyPairResponsePayload()
def test_write_with_none(self): stream = utils.BytearrayStream() payload = payloads.CreateKeyPairResponsePayload() self._test_write(stream, payload, self.encoding_empty)
def test_read_with_none(self): stream = self.encoding_empty payload = payloads.CreateKeyPairResponsePayload() self._test_read(stream, payload, self.empty_private_key_uuid, self.empty_public_key_uuid, None, None)
def test_init_with_args(self): payloads.CreateKeyPairResponsePayload( self.private_key_uuid, self.public_key_uuid, self.private_key_template_attribute, self.public_key_template_attribute)
def test_init_with_none(self): payloads.CreateKeyPairResponsePayload()