def test_service_merge_credentials(creds1, creds2, expected): service1 = ManualService("id1", Protocol.DMAP, 0, {}) service2 = ManualService("id2", Protocol.DMAP, 0, {}) service1.credentials = creds1 service2.credentials = creds2 service1.merge(service2) assert service1.credentials == expected
def _manual_device(args): config = AppleTV(IPv4Address(args.address), args.name) service = ManualService(args.id, args.protocol, args.port, {}) service.credentials = getattr(args, f"{args.protocol.name.lower()}_credentials") service.password = args.raop_password config.add_service(service) return config
async def setUpAsync(self): await super().setUpAsync() self.conf = AppleTV(IPv4Address("127.0.0.1"), "Test device") self.conf.add_service( ManualService("mrp_id", Protocol.MRP, self.fake_atv.get_port(Protocol.MRP), {})) airplay_service = ManualService( "airplay_id", Protocol.AirPlay, self.server.port, properties={"features": "0x1"}, # AirPlayVideoV1 supported ) airplay_service.credentials = DEVICE_CREDENTIALS self.conf.add_service(airplay_service) self.atv = await self.get_connected_device()