Beispiel #1
0
 def setUp(self):
     #from coherence.upnp.core import utils
     #utils.parse_xml(self._scpdXML, 'utf-8')
     #raise NotImplementedError(self._scpdXML)
     info = {
         'USN': "RootDevice's USN",
         'SERVER': "RootDevice's Server",
         'ST': "RootDevice's ST",
         'LOCATION': "http://localhost:8080/my-location",
         'MANIFESTATION': "RootDevice's Manifestation",
         'HOST': "RootDevice's Host",
         }
     # Create an empty RootDevice without services, actions, icons,
     # etc. Do not use DummyDevice here as we want to test URLs,
     # too.
     with mock.patch('coherence.upnp.core.utils.getPage', raiseError):
         self.device = device.RootDevice(info)
     # Since the Device has got no description, wenn need to set
     # urlbase manually. It is required to be set.
     # :fixme: this one is used in make_fullyqualified, rethink
     self.device.urlbase = 'http://localhost:8888'
     # Create the service we want to test, using meaningful values
     with mock.patch('coherence.upnp.core.utils.getPage',
                     fakeGetPage(self._scpdXML)):
         self.service = service.Service(
             'urn:schemas-upnp-org:service:RenderingControl:1',
             'urn:upnp-org:serviceId:RenderingControl',
             self.device.get_location(),
             '/my-service/control',
             '/my-service/subscribe',
             '/my-service/view',
             '/my-service/scpd',
             self.device)
Beispiel #2
0
 def setUp_main(self):
     info = {
         'USN': "RootDevice's USN",
         'SERVER': "RootDevice's Server",
         'ST': "RootDevice's ST",
         'LOCATION': "RootDevice's Location",
         'MANIFESTATION': "RootDevice's Manifestation",
         'HOST': "RootDevice's Host",
     }
     self.rootdevice = device.RootDevice(info)
Beispiel #3
0
 def setUp(self):
     self._location_url = self.__getURL('device-description-1.xml')
     info = {
         'ST': 'upnp:rootdevice',
         'USN': 'uuid:12345678-ABCE-klmn-RSTU-987654321098::upnp:rootdevice',
         'MANIFESTATION': 'remote',
         'HOST': '192.168.123.123',
         'SERVER': ('Linux/armv5tel-linux UPnP/1.0 DLNADOC/1.50 '
                    'SqueezeboxMediaServer/7.3.1/12345'),
         'LOCATION': self._location_url,
         }
     with mock.patch('coherence.upnp.core.utils.getPage', fakeGetPageURL):
         self.rootdevice = device.RootDevice(info)