from ipypbx.tests import support
from xml.etree import ElementTree as etree
+__all__ = (
+ 'TestHttpRequestParser', 'TestFreeswitchConfigGenerator',
+ 'TestSofiaConfGenerator')
+
class TestHttpRequestParser(unittest.TestCase):
"""
self.generator.canHandle({'foo': 'bar', 'qwe': 'asd'}), False)
def test_base_elements(self):
+ """
+ ipypbx.http.FreeswitchConfigGenerator.baseElements returns a tuple of
+ document and section elelements.
+ """
self.generator.param_match = {'section': 'foo'}
root_elt, section_elt = self.generator.baseElements
self.assertEqual(
etree.tostring(section_elt), '<section name="foo" />')
def test_add_params(self):
+ """
+ ipypbx.http.FreeswitchConfigGenerator.addParams is a helper method for
+ creating params element.
+ """
foo_elt = etree.Element('foo')
self.assertEqual(
etree.tostring(self.generator.addParams(foo_elt, (('qwe', 'asd'),))),
(('qwe', 'asd'), ('zxc', '123')))),
'<bar><params><param name="qwe" value="asd" />'
'<param name="zxc" value="123" /></params></bar>')
+
+
+class TestSofiaConfGenerator(unittest.TestCase):
+ def test_generate_config(self):
+ pass