Ejemplo n.º 1
0
 def test_init_remove_element_at_index(self):
     text = 'Hello from Avaya CPaaS!'
     number = Number(text)
     dial = Dial()
     dial.addElement(number)
     expected = '<Dial><Number>%s</Number></Dial>' % text
     assert dial.xml == expected
     dial.removeElementAtIndex(0)
     expected = '<Dial></Dial>'
     assert dial.xml == expected
Ejemplo n.º 2
0
 def test_remove_element_at_out_of_range_index(self):
     text = 'Hello from Avaya CPaaS!'
     number = Number(text)
     dial = Dial()
     dial.addElement(number)
     index = len(dial._content)
     self.assertRaises(IndexError, lambda: dial.removeElementAtIndex(index))