Skip to content

Commit 516c8ed

Browse files
committed
Update Plex Web URL tests
1 parent 49ce2f9 commit 516c8ed

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

tests/test_library.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ def test_library_MovieSection_PlexWebURL_hub(plex, movies):
231231
hubs = movies.hubs()
232232
hub = next(iter(hubs), None)
233233
assert hub is not None
234-
url = hub.getWebURL()
234+
url = hub.section().getWebURL(key=hub.key)
235235
assert url.startswith('https://app.plex.tv/desktop')
236236
assert plex.machineIdentifier in url
237237
assert 'source=%s' % movies.key in url

tests/test_server.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# -*- coding: utf-8 -*-
22
import re
33
import time
4+
from urllib.parse import quote_plus
45

56
import pytest
67
from datetime import datetime
@@ -514,14 +515,22 @@ def test_server_transcode_sessions(plex, requests_mock):
514515
assert utils.is_int(session.width, gte=852)
515516

516517

517-
def test_server_PlaylistsPlexWebURL(plex):
518-
tab = 'audio'
519-
url = plex.getPlaylistsWebURL(tab=tab)
518+
def test_server_PlexWebURL(plex):
519+
url = plex.getWebURL()
520520
assert url.startswith('https://app.plex.tv/desktop')
521521
assert plex.machineIdentifier in url
522-
assert 'source=playlists' in url
523-
assert 'pivot=playlists.%s' % tab in url
522+
assert quote_plus('/hubs') in url
523+
assert 'pageType=hub' in url
524524
# Test a different base
525525
base = 'https://doesnotexist.com/plex'
526-
url = plex.getPlaylistsWebURL(base=base)
526+
url = plex.getWebURL(base=base)
527527
assert url.startswith(base)
528+
529+
530+
def test_server_PlexWebURL_playlists(plex):
531+
tab = 'audio'
532+
url = plex.getWebURL(playlistTab=tab)
533+
assert url.startswith('https://app.plex.tv/desktop')
534+
assert plex.machineIdentifier in url
535+
assert 'source=playlists' in url
536+
assert 'pivot=playlists.%s' % tab in url

0 commit comments

Comments
 (0)