From 516c8ed02fad607157a5a3026820fb66c92d53da Mon Sep 17 00:00:00 2001 From: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> Date: Sun, 26 Sep 2021 15:23:18 -0700 Subject: [PATCH] Update Plex Web URL tests --- tests/test_library.py | 2 +- tests/test_server.py | 21 +++++++++++++++------ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/tests/test_library.py b/tests/test_library.py index 3a6442ec4..92205007b 100644 --- a/tests/test_library.py +++ b/tests/test_library.py @@ -231,7 +231,7 @@ def test_library_MovieSection_PlexWebURL_hub(plex, movies): hubs = movies.hubs() hub = next(iter(hubs), None) assert hub is not None - url = hub.getWebURL() + url = hub.section().getWebURL(key=hub.key) assert url.startswith('https://app.plex.tv/desktop') assert plex.machineIdentifier in url assert 'source=%s' % movies.key in url diff --git a/tests/test_server.py b/tests/test_server.py index c0f8afd9e..a6b364969 100644 --- a/tests/test_server.py +++ b/tests/test_server.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- import re import time +from urllib.parse import quote_plus import pytest from datetime import datetime @@ -514,14 +515,22 @@ def test_server_transcode_sessions(plex, requests_mock): assert utils.is_int(session.width, gte=852) -def test_server_PlaylistsPlexWebURL(plex): - tab = 'audio' - url = plex.getPlaylistsWebURL(tab=tab) +def test_server_PlexWebURL(plex): + url = plex.getWebURL() assert url.startswith('https://app.plex.tv/desktop') assert plex.machineIdentifier in url - assert 'source=playlists' in url - assert 'pivot=playlists.%s' % tab in url + assert quote_plus('/hubs') in url + assert 'pageType=hub' in url # Test a different base base = 'https://doesnotexist.com/plex' - url = plex.getPlaylistsWebURL(base=base) + url = plex.getWebURL(base=base) assert url.startswith(base) + + +def test_server_PlexWebURL_playlists(plex): + tab = 'audio' + url = plex.getWebURL(playlistTab=tab) + assert url.startswith('https://app.plex.tv/desktop') + assert plex.machineIdentifier in url + assert 'source=playlists' in url + assert 'pivot=playlists.%s' % tab in url