Example #1
0
    def setUp(self):
        super(Property, self).setUp()

        # Empty

        self.xml.append(cim_xml.PROPERTY('PropertyName', 'string', None))

        # PROPERTY

        self.xml.append(
            cim_xml.PROPERTY('PropertyName', 'string', cim_xml.VALUE('dog')))

        # PROPERTY + attributes

        self.xml.append(
            cim_xml.PROPERTY('PropertyName',
                             'string',
                             cim_xml.VALUE('dog'),
                             propagated='true',
                             class_origin='CIM_Pets'))

        # PROPERTY + QUALIFIER

        self.xml.append(
            cim_xml.PROPERTY('PropertyName',
                             'string',
                             cim_xml.VALUE('dog'),
                             qualifiers=[
                                 cim_xml.QUALIFIER('IMPISH', 'string',
                                                   cim_xml.VALUE('true'))
                             ]))
Example #2
0
    def setUp(self):
        super(Instance, self).setUp()

        # Empty

        self.xml.append(cim_xml.INSTANCE('CIM_Foo', []))

        # PROPERTY

        self.xml.append(
            cim_xml.INSTANCE('CIM_Foo', [
                cim_xml.PROPERTY('Dog', 'string', cim_xml.VALUE('Spotty')),
                cim_xml.PROPERTY('Cat', 'string', cim_xml.VALUE('Bella'))
            ]))

        # PROPERTY + QUALIFIER

        self.xml.append(
            cim_xml.INSTANCE('CIM_Foo',
                             properties=[
                                 cim_xml.PROPERTY('Dog', 'string',
                                                  cim_xml.VALUE('Spotty')),
                                 cim_xml.PROPERTY('Cat', 'string',
                                                  cim_xml.VALUE('Bella'))
                             ],
                             qualifiers=[
                                 cim_xml.QUALIFIER('IMPISH', 'string',
                                                   cim_xml.VALUE('true'))
                             ]))

        # PROPERTY.ARRAY

        self.xml.append(
            cim_xml.INSTANCE('CIM_Pets', [
                cim_xml.PROPERTY_ARRAY(
                    'Dogs', 'string',
                    cim_xml.VALUE_ARRAY(
                        [cim_xml.VALUE('Spotty'),
                         cim_xml.VALUE('Bronte')])),
                cim_xml.PROPERTY_ARRAY(
                    'Cats', 'string',
                    cim_xml.VALUE_ARRAY(
                        [cim_xml.VALUE('Bella'),
                         cim_xml.VALUE('Faux Lily')]))
            ]))

        # PROPERTY.REFERENCE

        self.xml.append(
            cim_xml.INSTANCE('CIM_Pets', [
                cim_xml.PROPERTY_REFERENCE(
                    'Dog', cim_xml.VALUE_REFERENCE(
                        cim_xml.CLASSNAME('CIM_Dog'))),
                cim_xml.PROPERTY_REFERENCE(
                    'Cat', cim_xml.VALUE_REFERENCE(
                        cim_xml.CLASSNAME('CIM_Cat')))
            ]))
Example #3
0
    def setUp(self):
        super(Class, self).setUp()

        # Empty

        self.xml.append(cim_xml.CLASS('CIM_Foo'))

        # PROPERTY

        self.xml.append(
            cim_xml.CLASS('CIM_Foo',
                          properties=[
                              cim_xml.PROPERTY('Dog', 'string',
                                               cim_xml.VALUE('Spotty'))
                          ]))

        # QUALIFIER + PROPERTY

        self.xml.append(
            cim_xml.CLASS('CIM_Foo',
                          properties=[
                              cim_xml.PROPERTY('Dog', 'string',
                                               cim_xml.VALUE('Spotty'))
                          ],
                          qualifiers=[
                              cim_xml.QUALIFIER('IMPISH', 'string',
                                                cim_xml.VALUE('true'))
                          ]))

        # PROPERTY.ARRAY

        self.xml.append(
            cim_xml.CLASS(
                'CIM_Foo',
                properties=[cim_xml.PROPERTY_ARRAY('Dogs', 'string', None)]))

        # PROPERTY.REFERENCE

        self.xml.append(
            cim_xml.CLASS(
                'CIM_Foo',
                properties=[cim_xml.PROPERTY_REFERENCE('Dogs', None)]))

        # METHOD

        self.xml.append(
            cim_xml.CLASS('CIM_Foo', methods=[cim_xml.METHOD('FooMethod')]))