Ejemplo n.º 1
0
 def testSetBeforeVal(self):
     s = Set()
     s['before'] = 'id'
     self.check(
         s, """
       <set xmlns="http://jabber.org/protocol/rsm">
         <before>id</before>
       </set>
     """)
Ejemplo n.º 2
0
 def testGetBefore(self):
     xml_string = """
       <set xmlns="http://jabber.org/protocol/rsm">
         <before />
       </set>
     """
     s = Set(ET.fromstring(xml_string))
     expected = True
     self.failUnless(s['before'] == expected)
Ejemplo n.º 3
0
 def testSetBefore(self):
     s = Set()
     s['before'] = True
     self.check(
         s, """
       <set xmlns="http://jabber.org/protocol/rsm">
         <before />
       </set>
     """)
Ejemplo n.º 4
0
 def testGetFirstIndex(self):
     xml_string = """
       <set xmlns="http://jabber.org/protocol/rsm">
         <first index="10">id</first>
       </set>
     """
     s = Set(ET.fromstring(xml_string))
     expected = '10'
     self.failUnless(s['first_index'] == expected)
Ejemplo n.º 5
0
 def testSetFirstIndex(self):
     s = Set()
     s['first'] = 'id'
     s.set_first_index('10')
     self.check(
         s, """
       <set xmlns="http://jabber.org/protocol/rsm">
         <first index="10">id</first>
       </set>
     """)
Ejemplo n.º 6
0
 def testGetBeforeVal(self):
     xml_string = """
       <set xmlns="http://jabber.org/protocol/rsm">
         <before>id</before>
       </set>
     """
     s = Set(ET.fromstring(xml_string))
     del s['before']
     self.check(
         s, """
       <set xmlns="http://jabber.org/protocol/rsm">
       </set>
     """)
Ejemplo n.º 7
0
 def testDelFirstIndex(self):
     xml_string = """
       <set xmlns="http://jabber.org/protocol/rsm">
         <first index="10">id</first>
       </set>
     """
     s = Set(ET.fromstring(xml_string))
     del s['first_index']
     self.check(
         s, """
       <set xmlns="http://jabber.org/protocol/rsm">
         <first>id</first>
       </set>
     """)