mirror of
https://github.com/pkkid/python-plexapi
synced 2025-02-16 12:58:26 +00:00
Tests skip additional tests that require plex pass (#1227)
* tests: skip additional tests that require Plex Pass * tests(test_myplex_users): check if first user has access to any server * tests(fixture): adjust plex pass required skip message
This commit is contained in:
parent
ec4b779ca8
commit
b783a56edc
4 changed files with 11 additions and 5 deletions
|
@ -143,7 +143,8 @@ def account_once(account):
|
||||||
def account_plexpass(account):
|
def account_plexpass(account):
|
||||||
if not account.subscriptionActive:
|
if not account.subscriptionActive:
|
||||||
pytest.skip(
|
pytest.skip(
|
||||||
"PlexPass subscription is not active, unable to test sync-stuff, be careful!"
|
"PlexPass subscription is not active, unable to test dashboard, movie extras, movie editions, "
|
||||||
|
"or sync-stuff, be careful!"
|
||||||
)
|
)
|
||||||
return account
|
return account
|
||||||
|
|
||||||
|
|
|
@ -77,6 +77,11 @@ def test_myplex_users(account):
|
||||||
print(f"Found user: {user}")
|
print(f"Found user: {user}")
|
||||||
assert user, f"Could not find user {users[0].title}"
|
assert user, f"Could not find user {users[0].title}"
|
||||||
|
|
||||||
|
try:
|
||||||
|
users[0].servers[0]
|
||||||
|
except IndexError:
|
||||||
|
return pytest.skip(f"{users[0].title} shared user does not have access to any servers")
|
||||||
|
|
||||||
assert (
|
assert (
|
||||||
len(users[0].servers[0].sections()) > 0
|
len(users[0].servers[0].sections()) > 0
|
||||||
), "Couldn't info about the shared libraries"
|
), "Couldn't info about the shared libraries"
|
||||||
|
|
|
@ -439,7 +439,7 @@ def test_server_system_devices(plex):
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.authenticated
|
@pytest.mark.authenticated
|
||||||
def test_server_dashboard_bandwidth(plex):
|
def test_server_dashboard_bandwidth(account_plexpass, plex):
|
||||||
bandwidthData = plex.bandwidth()
|
bandwidthData = plex.bandwidth()
|
||||||
assert len(bandwidthData)
|
assert len(bandwidthData)
|
||||||
bandwidth = bandwidthData[0]
|
bandwidth = bandwidthData[0]
|
||||||
|
@ -456,7 +456,7 @@ def test_server_dashboard_bandwidth(plex):
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.authenticated
|
@pytest.mark.authenticated
|
||||||
def test_server_dashboard_bandwidth_filters(plex):
|
def test_server_dashboard_bandwidth_filters(account_plexpass, plex):
|
||||||
at = datetime(2021, 1, 1)
|
at = datetime(2021, 1, 1)
|
||||||
filters = {
|
filters = {
|
||||||
'at>': at,
|
'at>': at,
|
||||||
|
|
|
@ -586,7 +586,7 @@ def test_video_Movie_editions(movie):
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.authenticated
|
@pytest.mark.authenticated
|
||||||
def test_video_Movie_extras(movies):
|
def test_video_Movie_extras(account_plexpass, movies):
|
||||||
movie = movies.get("Sita Sings The Blues")
|
movie = movies.get("Sita Sings The Blues")
|
||||||
extras = movie.extras()
|
extras = movie.extras()
|
||||||
assert extras
|
assert extras
|
||||||
|
@ -677,7 +677,7 @@ def test_video_Movie_mixins_fields_edition(movie):
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.authenticated
|
@pytest.mark.authenticated
|
||||||
def test_video_Movie_mixins_fields_edition_authenticated(movie):
|
def test_video_Movie_mixins_fields_edition_authenticated(account_plexpass, movie):
|
||||||
test_mixins.edit_edition_title(movie)
|
test_mixins.edit_edition_title(movie)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue