Exemple #1
0
async def test_unicast_scan_raop(udns_server, unicast_scan):
    udns_server.add_service(
        fake_udns.raop_service(RAOP_NAME,
                               RAOP_ID,
                               addresses=[IP_1],
                               port=RAOP_PORT))

    atvs = await unicast_scan()
    assert len(atvs) == 1

    assert_device(atvs[0], RAOP_NAME, ip_address(IP_1), RAOP_ID, Protocol.RAOP,
                  RAOP_PORT)
Exemple #2
0
async def test_unicast_scan_mrp(udns_server, unicast_scan):
    udns_server.add_service(
        fake_udns.mrp_service(MRP_SERVICE_NAME,
                              MRP_NAME,
                              MRP_ID,
                              addresses=[IP_1],
                              port=MRP_PORT))

    atvs = await unicast_scan()
    assert len(atvs) == 1

    assert_device(atvs[0], MRP_NAME, ip_address(IP_1), MRP_ID, Protocol.MRP,
                  MRP_PORT)
Exemple #3
0
async def test_multicast_scan_mrp_with_companion(udns_server, multicast_scan):
    udns_server.add_service(
        fake_udns.mrp_service(MRP_SERVICE_NAME,
                              MRP_NAME,
                              MRP_ID,
                              addresses=[IP_1],
                              port=MRP_PORT))

    atvs = await multicast_scan(protocol=Protocol.MRP)
    assert len(atvs) == 1

    assert_device(atvs[0], MRP_NAME, ip_address(IP_1), MRP_ID, Protocol.MRP,
                  MRP_PORT)
Exemple #4
0
async def test_unicast_scan_no_homesharing(udns_server, unicast_scan):
    udns_server.add_service(
        fake_udns.device_service(DMAP_SERVICE_NAME,
                                 DMAP_NAME,
                                 addresses=[IP_1]))

    atvs = await unicast_scan()
    assert len(atvs) == 1

    assert_device(
        atvs[0],
        DMAP_NAME,
        ip_address(IP_1),
        DMAP_SERVICE_NAME,
        Protocol.DMAP,
        3689,
    )
Exemple #5
0
async def test_unicast_scan_airplay(udns_server, unicast_scan: Scanner):
    udns_server.add_service(
        fake_udns.airplay_service(AIRPLAY_NAME,
                                  AIRPLAY_ID,
                                  addresses=[IP_1],
                                  port=7000))

    atvs = await unicast_scan()
    assert len(atvs) == 1

    assert_device(
        atvs[0],
        AIRPLAY_NAME,
        ip_address(IP_1),
        AIRPLAY_ID,
        Protocol.AirPlay,
        7000,
    )
Exemple #6
0
async def test_multicast_scan_hscp_device(udns_server, multicast_scan):
    udns_server.add_service(
        fake_udns.hscp_service(DMAP_NAME,
                               DMAP_SERVICE_NAME,
                               DMAP_HSGID,
                               addresses=[IP_1],
                               port=3689))

    atvs = await multicast_scan()
    assert len(atvs) == 1
    assert_device(
        atvs[0],
        DMAP_NAME,
        ip_address(IP_1),
        DMAP_SERVICE_NAME,
        Protocol.DMAP,
        3689,
        DMAP_HSGID,
    )
Exemple #7
0
async def test_multicast_scan_home_sharing_merge(udns_server, multicast_scan):
    udns_server.add_service(
        fake_udns.device_service(DMAP_SERVICE_NAME,
                                 DMAP_NAME,
                                 addresses=[IP_1]))
    udns_server.add_service(
        fake_udns.homesharing_service(DMAP_SERVICE_NAME,
                                      DMAP_NAME,
                                      DMAP_HSGID,
                                      addresses=[IP_1]))

    atvs = await multicast_scan()
    assert len(atvs) == 1

    assert_device(
        atvs[0],
        DMAP_NAME,
        ip_address(IP_1),
        DMAP_SERVICE_NAME,
        Protocol.DMAP,
        3689,
        DMAP_HSGID,
    )