Fix image mixins tests (#856)

* Unlock images after edit image test

* Enable playlist art mixins tests

* Mark all image mixins tests as xfail

* Changing images can fail randomly
This commit is contained in:
JonnyWong16 2021-11-20 17:14:34 -08:00 committed by GitHub
parent 15e011fd29
commit a9ffd1e738
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 16 additions and 3 deletions

View file

@ -85,6 +85,7 @@ def test_audio_Artist_mixins_edit_advanced_settings(artist):
test_mixins.edit_advanced_settings(artist)
@pytest.mark.xfail(reason="Changing images fails randomly")
def test_audio_Artist_mixins_images(artist):
test_mixins.lock_art(artist)
test_mixins.lock_poster(artist)
@ -194,6 +195,7 @@ def test_audio_Album_artist(album):
artist.title == "Broke For Free"
@pytest.mark.xfail(reason="Changing images fails randomly")
def test_audio_Album_mixins_images(album):
test_mixins.lock_art(album)
test_mixins.lock_poster(album)

View file

@ -272,6 +272,7 @@ def test_Collection_art(collection):
assert not arts # Collection has no default art
@pytest.mark.xfail(reason="Changing images fails randomly")
def test_Collection_mixins_images(collection):
test_mixins.lock_art(collection)
test_mixins.lock_poster(collection)

View file

@ -139,6 +139,9 @@ def _test_mixins_edit_image(obj, attr):
# Reset to default image
if default_image:
set_img_method(default_image)
# Unlock the image
unlock_img_method = getattr(obj, "unlock" + cap_attr)
unlock_img_method()
def edit_art(obj):

View file

@ -1,6 +1,8 @@
# -*- coding: utf-8 -*-
from urllib.parse import quote_plus
import pytest
from . import test_media, test_mixins
@ -13,6 +15,7 @@ def test_photo_Photoalbum(photoalbum):
assert a_pic
@pytest.mark.xfail(reason="Changing images fails randomly")
def test_photo_Photoalbum_mixins_images(photoalbum):
# test_mixins.lock_art(photoalbum) # Unlocking photoalbum artwork is broken in Plex
# test_mixins.lock_poster(photoalbum) # Unlocking photoalbum poster is broken in Plex

View file

@ -273,8 +273,9 @@ def test_Playlist_PlexWebURL(plex, show):
playlist.delete()
@pytest.mark.xfail(reason="Changing images fails randomly")
def test_Playlist_mixins_images(playlist):
# test_mixins.lock_art(playlist)
test_mixins.lock_art(playlist)
test_mixins.lock_poster(playlist)
# test_mixins.edit_art(playlist)
test_mixins.edit_art(playlist)
test_mixins.edit_poster(playlist)

View file

@ -44,6 +44,7 @@ def test_video_Movie_mixins_edit_advanced_settings(movie):
test_mixins.edit_advanced_settings(movie)
@pytest.mark.xfail(reason="Changing images fails randomly")
def test_video_Movie_mixins_images(movie):
test_mixins.lock_art(movie)
test_mixins.lock_poster(movie)
@ -788,7 +789,7 @@ def test_video_Show_mixins_edit_advanced_settings(show):
test_mixins.edit_advanced_settings(show)
@pytest.mark.xfail(reason="Changing show art fails randomly")
@pytest.mark.xfail(reason="Changing images fails randomly")
def test_video_Show_mixins_images(show):
test_mixins.lock_art(show)
test_mixins.lock_poster(show)
@ -918,6 +919,7 @@ def test_video_Season_episodes(show):
assert len(episodes) >= 1
@pytest.mark.xfail(reason="Changing images fails randomly")
def test_video_Season_mixins_images(show):
season = show.season(season=1)
test_mixins.lock_art(season)
@ -1129,6 +1131,7 @@ def test_video_Episode_unwatched(tvshows):
episode.markUnwatched()
@pytest.mark.xfail(reason="Changing images fails randomly")
def test_video_Episode_mixins_images(episode):
test_mixins.lock_art(episode)
test_mixins.lock_poster(episode)