'Test manipulating presence[\'type\']'

def testPresenceType(self):

    p = self.Presence()
    p['type'] = 'available'
    self.check(p, '<presence    />')
    self.failUnless((p['type'] == 'available'), ("Incorrect    presence['type']    for    type    'available':    %s" % p['type']))
    for showtype in ['away', 'chat', 'dnd', 'xa']:
        p['type'] = showtype
        self.check(p, ('\n                                                        <presence><show>%s</show></presence>\n                                                ' % showtype))
        self.failUnless((p['type'] == showtype), ("Incorrect    presence['type']    for    type    '%s'" % showtype))
    p['type'] = None
    self.check(p, '<presence    />')
