'test of set request stanza'

def testSetRequest(self):

    iq = self.Iq()
    iq['type'] = 'set'
    iq['from'] = 'master@clayster.com/amr'
    iq['to'] = 'device@clayster.com'
    iq['id'] = '1'
    iq['set'].add_node('Device02', 'Source02', 'MyCacheType')
    iq['set'].add_node('Device15')
    iq['set'].add_data('Tjohej', 'boolean', 'true')
    self.check(iq, "\n                                                <iq    type='set'\n                                                                from='master@clayster.com/amr'\n                                                                to='device@clayster.com'\n                                                                id='1'>\n                                                                <set    xmlns='urn:xmpp:iot:control'>\n                                                                                <node    nodeId='Device02'    sourceId='Source02'    cacheType='MyCacheType'/>\n                                                                                <node    nodeId='Device15'/>\n                                                                                <boolean    name='Tjohej'    value='true'/>\n                                                                </set>\n                                                </iq>\n                                ")
    iq['set'].del_node('Device02')
    self.check(iq, "\n                                                <iq    type='set'\n                                                                from='master@clayster.com/amr'\n                                                                to='device@clayster.com'\n                                                                id='1'>\n                                                                <set    xmlns='urn:xmpp:iot:control'>\n                                                                                <node    nodeId='Device15'/>\n                                                                                <boolean    name='Tjohej'    value='true'/>\n                                                                </set>\n                                                </iq>\n                                ")
    iq['set'].del_nodes()
    self.check(iq, "\n                                                <iq    type='set'\n                                                                from='master@clayster.com/amr'\n                                                                to='device@clayster.com'\n                                                                id='1'>\n                                                                <set    xmlns='urn:xmpp:iot:control'>\n                                                                                <boolean    name='Tjohej'    value='true'/>\n                                                                </set>\n                                                </iq>\n                                ")
