コード例 #1
0
 def test_create_open_message_parsable(self):
     from xml.parsers.expat import ExpatError
     msg, _ = upnp._create_open_message('127.0.0.1', 8888)
     try:
         upnp.parseString(msg)
     except ExpatError as e:
         pytest.fail('Incorrect XML message: {}'.format(e))
コード例 #2
0
ファイル: TestUpnpPunch.py プロジェクト: 0-vortex/ZeroNet
 def test_create_open_message_parsable(self):
     from xml.parsers.expat import ExpatError
     msg, _ = upnp._create_open_message('127.0.0.1', 8888)
     try:
         upnp.parseString(msg)
     except ExpatError as e:
         pytest.fail('Incorrect XML message: {}'.format(e))
コード例 #3
0
ファイル: TestUpnpPunch.py プロジェクト: 0-vortex/ZeroNet
 def test_create_open_message_contains_right_stuff(self):
     settings = {'description': 'test desc',
                 'protocol': 'test proto',
                 'upnp_schema': 'test schema'}
     msg, fn_name = upnp._create_open_message('127.0.0.1', 8888, **settings)
     assert fn_name == 'AddPortMapping'
     assert '127.0.0.1' in msg
     assert '8888' in msg
     assert settings['description'] in msg
     assert settings['protocol'] in msg
     assert settings['upnp_schema'] in msg
コード例 #4
0
 def test_create_open_message_contains_right_stuff(self):
     settings = {
         'description': 'test desc',
         'protocol': 'test proto',
         'upnp_schema': 'test schema'
     }
     msg, fn_name = upnp._create_open_message('127.0.0.1', 8888, **settings)
     assert fn_name == 'AddPortMapping'
     assert '127.0.0.1' in msg
     assert '8888' in msg
     assert settings['description'] in msg
     assert settings['protocol'] in msg
     assert settings['upnp_schema'] in msg