示例#1
0
    def test_get_entries_incompatible_models(self):
        supported_model = MockUPNPEntry("desc_RX-V481.xml")
        devices = [supported_model, MockUPNPEntry("desc_R-N602.xml")]

        discoverable = Discoverable(None)
        discoverable.find_by_device_description = MagicMock(
            return_value=devices)

        self.assertEqual(discoverable.get_entries(), [supported_model])
示例#2
0
    def test_get_entries_incompatible_models(self):
        supported_model = MockUPNPEntry(
            "desc_multiple_services_no_remote_control.xml")
        devices = [
            supported_model,
            MockUPNPEntry("desc_incompatible_device.xml")
        ]

        discoverable = Discoverable(None)
        discoverable.INCOMPATIBLE_MODELS = ["aaa"]
        discoverable.find_by_device_description = MagicMock(
            return_value=devices)

        self.assertEqual(discoverable.get_entries(), [supported_model])