示例#1
0
class TestFritzXmlParser(unittest.TestCase):
    def setUp(self):
        self.fp = FritzXmlParser(None, None, filename=DESCRIPTION_FILE)
        self.namespace = 'urn:schemas-upnp-org:device-1-0'

    def test_namespace(self):
        self.assertEqual(self.namespace, self.fp.namespace)

    def test_nodename(self):
        self.assertEqual('{%s}%s' % (self.namespace, 'mynode'),
                         self.fp.nodename('mynode'))
示例#2
0
class TestFritzXmlParser(unittest.TestCase):

    def setUp(self):
        self.fp = FritzXmlParser(None, None, filename=DESCRIPTION_FILE)
        self.namespace = 'urn:schemas-upnp-org:device-1-0'

    def test_namespace(self):
        self.assertEqual(self.namespace, self.fp.namespace)

    def test_nodename(self):
        self.assertEqual('{%s}%s' % (self.namespace, 'mynode'),
                          self.fp.nodename('mynode'))
示例#3
0
 def action_test_connection(self, args):
     _logger.debug('Testing FritzBox connection...')
     connection = self.get_connection()
     _logger.debug('Service-Descriptions loaded')
     result = connection[0].call_action('X_AVM-DE_OnTel',
                                        'GetPhonebook',
                                        NewPhonebookID=0)
     fxp = FritzXmlParser(url=result['NewPhonebookURL'])
     nodes = fxp.root.iterfind('.//contact')
     _logger.debug('Trying to print telephone-book:')
     for node in nodes:
         _logger.debug(
             '#%s %s: %s' %
             (node.find('uniqueid').text, node.find('person/realName').text,
              node.find('telephony/number').text))
示例#4
0
 def setUp(self):
     self.fp = FritzXmlParser(None, None, filename=DESCRIPTION_FILE)
     self.namespace = 'urn:schemas-upnp-org:device-1-0'
示例#5
0
 def setUp(self):
     self.fp = FritzXmlParser(None, None, filename=DESCRIPTION_FILE)
     self.namespace = 'urn:schemas-upnp-org:device-1-0'