'Test handling roster item removal updates.'

def testRosterPushRemove(self):

    self.stream_start(mode=u'client')
    events = []
    self.recv(u'\n                                        <iq    to=\'tester@localhost\'    type="set"    id="1">\n                                                <query    xmlns="jabber:iq:roster">\n                                                        <item    jid="user@localhost"\n                                                                                name="User"\n                                                                                subscription="both">\n                                                                <group>Friends</group>\n                                                                <group>Examples</group>\n                                                        </item>\n                                                </query>\n                                        </iq>\n                                ')
    self.send(u'\n                                        <iq    type="result"    id="1">\n                                                <query    xmlns="jabber:iq:roster"    />\n                                        </iq>\n                                ')
    self.assertTrue((u'user@localhost' in self.xmpp.client_roster))
    self.recv(u'\n                                        <iq    to=\'tester@localhost\'    type="set"    id="1">\n                                                <query    xmlns="jabber:iq:roster">\n                                                        <item    jid="user@localhost"\n                                                                                subscription="remove">\n                                                        </item>\n                                                </query>\n                                        </iq>\n                                ')
    self.send(u'\n                                        <iq    type="result"    id="1">\n                                                <query    xmlns="jabber:iq:roster"    />\n                                        </iq>\n                                ')
    self.assertTrue((u'user@localhost' not in self.xmpp.client_roster))
