' \
'This is Test' \
@@ -80,4 +81,4 @@ def test_set_methods(self):
)
)
).to_string(False)
- self.assertEqual(response, expected_response)
+ self.assertXmlEqual(response, expected_response)
diff --git a/tests/xml/test_phonemeElement.py b/tests/xml/test_phonemeElement.py
index fc0af8c5..efa92a64 100644
--- a/tests/xml/test_phonemeElement.py
+++ b/tests/xml/test_phonemeElement.py
@@ -1,9 +1,10 @@
from unittest import TestCase
from plivo import plivoxml
+from tests import PlivoXmlTestCase
-class ElementTest(TestCase):
+class ElementTest(TestCase, PlivoXmlTestCase):
def test_set_methods(self):
alphabet = "ipa"
ph = "təmei̥ɾou̥"
@@ -16,4 +17,4 @@ def test_set_methods(self):
plivoxml.PhonemeElement("Well").set_alphabet(alphabet).set_ph(ph)
)
).to_string(False)
- self.assertEqual(response, expected_response)
+ self.assertXmlEqual(response, expected_response)
diff --git a/tests/xml/test_playElement.py b/tests/xml/test_playElement.py
index 6f432a03..7b503860 100644
--- a/tests/xml/test_playElement.py
+++ b/tests/xml/test_playElement.py
@@ -1,17 +1,18 @@
from unittest import TestCase
from plivo import plivoxml
+from tests import PlivoXmlTestCase
-class PlayElementTest(TestCase):
+class PlayElementTest(TestCase, PlivoXmlTestCase):
def test_set_methods(self):
expected_response = 'This is test'
-
+
loop = 1
content = 'This is test'
element = plivoxml.ResponseElement()
-
+
response = element.add(
plivoxml.PlayElement(content).set_loop(loop)
).to_string(False)
- self.assertEqual(response, expected_response)
+ self.assertXmlEqual(response, expected_response)
diff --git a/tests/xml/test_preAnswerElement.py b/tests/xml/test_preAnswerElement.py
index 9d1cdc86..ab1017c9 100644
--- a/tests/xml/test_preAnswerElement.py
+++ b/tests/xml/test_preAnswerElement.py
@@ -1,9 +1,10 @@
from unittest import TestCase
from plivo import plivoxml
+from tests import PlivoXmlTestCase
-class PreAnswerElementTest(TestCase):
+class PreAnswerElementTest(TestCase, PlivoXmlTestCase):
def test_set_methods(self):
expected_response = 'This is test' \
'This is test' \
@@ -89,4 +90,4 @@ def test_set_methods(self):
)
)
).to_string(False)
- self.assertEqual(response, expected_response)
+ self.assertXmlEqual(response, expected_response)
diff --git a/tests/xml/test_recordElement.py b/tests/xml/test_recordElement.py
index 94c325f5..9d384e11 100644
--- a/tests/xml/test_recordElement.py
+++ b/tests/xml/test_recordElement.py
@@ -1,8 +1,9 @@
from unittest import TestCase
from plivo import plivoxml
+from tests import PlivoXmlTestCase
-class RecordElementTest(TestCase):
+class RecordElementTest(TestCase, PlivoXmlTestCase):
def test_set_methods(self):
expected_response = '')
def test_add_conference(self):
content = 'test'
elem = plivoxml.ResponseElement().add_conference(
content=content).to_string(False)
- self.assertEqual(
+ self.assertXmlEqual(
elem, 'test')
def test_add_dial(self):
time = 2
elem = plivoxml.ResponseElement().add_dial(time_limit=time).to_string(False)
- self.assertEqual(elem,
+ self.assertXmlEqual(elem,
'')
def test_add_dtmf(self):
content = 'dummy'
elem = plivoxml.ResponseElement().add_dtmf(content=content).to_string(False)
- self.assertEqual(elem, 'dummy')
+ self.assertXmlEqual(elem, 'dummy')
def test_add_get_digits(self):
content = 2
elem = plivoxml.ResponseElement().add_get_digits(
timeout=content).to_string(False)
- self.assertEqual(
+ self.assertXmlEqual(
elem, '')
def test_add_get_input(self):
content = 2
elem = plivoxml.ResponseElement().add_get_input(
execution_timeout=content).to_string(False)
- self.assertEqual(
+ self.assertXmlEqual(
elem, '')
def test_add_hangup(self):
content = 'dummy'
elem = plivoxml.ResponseElement().add_hangup(
reason=content).to_string(False)
- self.assertEqual(
+ self.assertXmlEqual(
elem, '')
def test_add_message(self):
content = 'dummy'
elem = plivoxml.ResponseElement().add_message(
content=content).to_string(False)
- self.assertEqual(elem,
+ self.assertXmlEqual(elem,
'dummy')
def test_add_play(self):
content = 'dummy'
elem = plivoxml.ResponseElement().add_play(content=content).to_string(False)
- self.assertEqual(elem, 'dummy')
+ self.assertXmlEqual(elem, 'dummy')
def test_add_pre_answer(self):
elem = plivoxml.ResponseElement().add_pre_answer().to_string(False)
- self.assertEqual(elem,
+ self.assertXmlEqual(elem,
'')
def test_add_record(self):
action = 'https://foo.example.com'
elem = plivoxml.ResponseElement().add_record(action=action).to_string(False)
expected_response = ''
- self.assertEqual(elem, expected_response)
+ self.assertXmlEqual(elem, expected_response)
def test_add_redirect(self):
content = 'dummy'
elem = plivoxml.ResponseElement().add_redirect(
content=content).to_string(False)
- self.assertEqual(elem,
+ self.assertXmlEqual(elem,
'dummy')
def test_add_speak(self):
@@ -92,7 +93,7 @@ def test_add_speak(self):
finish_on_key='*'))
response.add(plivoxml.SpeakElement('Recording not received.'))
elem = response.to_string(False)
- self.assertEqual(
+ self.assertXmlEqual(
elem,
'Please leave a message after the beep. Press the star key when done.Recording not received.'
)
@@ -100,7 +101,7 @@ def test_add_speak(self):
def test_add_wait(self):
content = 2
elem = plivoxml.ResponseElement().add_wait(length=content).to_string(False)
- self.assertEqual(elem,
+ self.assertXmlEqual(elem,
'')
def test_add_mpc(self):
@@ -123,4 +124,4 @@ def test_add_mpc(self):
record=True, record_file_format='wav', mute=True,
enter_sound='beep:2', exit_sound='beep:1', hold=True,
on_exit_action_url='https://plivo.com/exitAction')
- self.assertEqual(expected_xml, elem.to_string(False))
+ self.assertXmlEqual(expected_xml, elem.to_string(False))
diff --git a/tests/xml/test_sElement.py b/tests/xml/test_sElement.py
index 7f6b7df2..6eaf858f 100644
--- a/tests/xml/test_sElement.py
+++ b/tests/xml/test_sElement.py
@@ -1,9 +1,10 @@
from unittest import TestCase
from plivo import plivoxml
+from tests import PlivoXmlTestCase
-class SElementTest(TestCase):
+class SElementTest(TestCase, PlivoXmlTestCase):
def test_set_methods(self):
expected_response = '' \
'This is TestThis is ' \
@@ -76,4 +77,4 @@ def test_set_methods(self):
)
)
).to_string(False)
- self.assertEqual(response, expected_response)
+ self.assertXmlEqual(response, expected_response)
diff --git a/tests/xml/test_sayAsElement.py b/tests/xml/test_sayAsElement.py
index ad7b2ad9..d7da9b98 100644
--- a/tests/xml/test_sayAsElement.py
+++ b/tests/xml/test_sayAsElement.py
@@ -1,9 +1,10 @@
from unittest import TestCase
from plivo import plivoxml
+from tests import PlivoXmlTestCase
-class SayAsElementTest(TestCase):
+class SayAsElementTest(TestCase, PlivoXmlTestCase):
def test_set_methods(self):
expected_response = '' \
'This is Test'
@@ -19,4 +20,4 @@ def test_set_methods(self):
)
).to_string(False)
- self.assertEqual(response, expected_response)
+ self.assertXmlEqual(response, expected_response)
diff --git a/tests/xml/test_speakElement.py b/tests/xml/test_speakElement.py
index ef3f6ef8..2a3eeb18 100644
--- a/tests/xml/test_speakElement.py
+++ b/tests/xml/test_speakElement.py
@@ -1,9 +1,10 @@
from unittest import TestCase
from plivo import plivoxml
+from tests import PlivoXmlTestCase
-class SpeakElementTest(TestCase):
+class SpeakElementTest(TestCase, PlivoXmlTestCase):
def test_set_methods(self):
expected_response = 'This is Test' \
'This is Test'
@@ -22,4 +23,4 @@ def test_set_methods(self):
).set_sip_headers(sip_headers)
)
).to_string(False)
- self.assertEqual(response, expected_response)
+ self.assertXmlEqual(response, expected_response)
diff --git a/tests/xml/test_wElement.py b/tests/xml/test_wElement.py
index 5b749a9c..d4cfcdb2 100644
--- a/tests/xml/test_wElement.py
+++ b/tests/xml/test_wElement.py
@@ -1,9 +1,10 @@
from unittest import TestCase
from plivo import plivoxml
+from tests import PlivoXmlTestCase
-class WElementTest(TestCase):
+class WElementTest(TestCase, PlivoXmlTestCase):
def test_set_methods(self):
expected_response = 'This is Test' \
'This is Test' \
@@ -68,4 +69,4 @@ def test_set_methods(self):
alias=alias_sub,
))
).to_string(False)
- self.assertEqual(response, expected_response)
+ self.assertXmlEqual(response, expected_response)
diff --git a/tests/xml/test_waitElement.py b/tests/xml/test_waitElement.py
index e3ded1f6..e343dcee 100644
--- a/tests/xml/test_waitElement.py
+++ b/tests/xml/test_waitElement.py
@@ -1,9 +1,10 @@
from unittest import TestCase
from plivo import plivoxml
+from tests import PlivoXmlTestCase
-class WaitElementTest(TestCase):
+class WaitElementTest(TestCase, PlivoXmlTestCase):
def test_set_methods(self):
expected_response = ''
@@ -19,4 +20,4 @@ def test_set_methods(self):
).set_min_silence(min_silence).set_beep(beep)
).to_string(False)
- self.assertEqual(response, expected_response)
+ self.assertXmlEqual(response, expected_response)