예제 #1
0
    def testClear(self):
        """Test clearing a stanza."""
        stanza = StanzaBase()
        stanza['to'] = '*****@*****.**'
        stanza['payload'] = ET.Element("{foo}foo")
        stanza.clear()

        self.assertTrue(stanza['payload'] == [],
            "Stanza payload was not cleared after calling .clear()")
        self.assertTrue(str(stanza['to']) == "*****@*****.**",
            "Stanza attributes were not preserved after calling .clear()")
예제 #2
0
    def testClear(self):
        """Test clearing a stanza."""
        stanza = StanzaBase()
        stanza['to'] = '*****@*****.**'
        stanza['payload'] = ET.Element("{foo}foo")
        stanza.clear()

        self.assertTrue(stanza['payload'] == [],
            "Stanza payload was not cleared after calling .clear()")
        self.assertTrue(str(stanza['to']) == "*****@*****.**",
            "Stanza attributes were not preserved after calling .clear()")
예제 #3
0
    def testClear(self):
        """Test clearing a stanza."""
        stanza = StanzaBase()
        stanza["to"] = "*****@*****.**"
        stanza["payload"] = ET.Element("{foo}foo")
        stanza.clear()

        self.failUnless(stanza["payload"] == [], "Stanza payload was not cleared after calling .clear()")
        self.failUnless(
            str(stanza["to"]) == "*****@*****.**", "Stanza attributes were not preserved after calling .clear()"
        )