コード例 #1
0
    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)
コード例 #2
0
    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)
コード例 #3
0
    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)
コード例 #4
0
    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)
コード例 #5
0
ファイル: response.py プロジェクト: zmole945/PyKMIP
 def _create_create_key_pair_payload(self):
     return payloads.CreateKeyPairResponsePayload()
コード例 #6
0
    def test_write_with_none(self):
        stream = utils.BytearrayStream()
        payload = payloads.CreateKeyPairResponsePayload()

        self._test_write(stream, payload, self.encoding_empty)
コード例 #7
0
    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)
コード例 #8
0
 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)
コード例 #9
0
 def test_init_with_none(self):
     payloads.CreateKeyPairResponsePayload()