'Test using boolean interfaces.'

def testBoolInterfaces(self):

    class TestStanza(ElementBase, ):
        name = 'foo'
        namespace = 'foo'
        interfaces = set(['bar'])
        bool_interfaces = interfaces
    stanza = TestStanza()
    self.check(stanza, '\n                                        <foo    xmlns="foo"    />\n                                ')
    self.assertFalse(stanza['bar'], 'Returned    True    for    missing    bool    interface    element.')
    stanza['bar'] = True
    self.check(stanza, '\n                                        <foo    xmlns="foo">\n                                                <bar    />\n                                        </foo>\n                                ')
    self.assertTrue(stanza['bar'], 'Returned    False    for    present    bool    interface    element.')
    stanza['bar'] = False
    self.check(stanza, '\n                                        <foo    xmlns="foo"    />\n                                ')
