Esempio n. 1
0
    def test_build_common_attributes(self):
        """
        Test that the right attribute objects are created.
        """
        client = ProxyKmipClient()
        client.open()

        operation_policy_name = 'test'
        common_attributes = client._build_common_attributes(
            operation_policy_name=operation_policy_name)

        self.assertEqual(1, len(common_attributes))

        opn = common_attributes[0]
        self.assertIsInstance(opn, obj.Attribute)
        self.assertIsInstance(opn.attribute_name, obj.Attribute.AttributeName)
        self.assertIsInstance(opn.attribute_value, attr.OperationPolicyName)
        self.assertEqual(opn.attribute_name.value, 'Operation Policy Name')
        self.assertEqual(opn.attribute_value.value, 'test')