'Test assigning to stanza interfaces.'

def testSetItem(self):

    class TestStanza(ElementBase, ):
        name = 'foo'
        namespace = 'foo'
        interfaces = set(('bar', 'baz', 'qux'))
        sub_interfaces = set(('baz',))
        def setQux(self, value):
            pass
    class TestStanzaPlugin(ElementBase, ):
        name = 'foobar'
        namespace = 'foo'
        plugin_attrib = 'foobar'
        interfaces = set(('foobar',))
    register_stanza_plugin(TestStanza, TestStanzaPlugin)
    stanza = TestStanza()
    stanza['bar'] = 'attribute!'
    stanza['baz'] = 'element!'
    stanza['qux'] = 'overridden'
    stanza['foobar'] = 'plugin'
    self.check(stanza, '\n                                        <foo    xmlns="foo"    bar="attribute!">\n                                                <baz>element!</baz>\n                                                <foobar    foobar="plugin"    />\n                                        </foo>\n                                ')
