From 497430fe8662cc68b324feb422afd3ea241b3ff8 Mon Sep 17 00:00:00 2001 From: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> Date: Sat, 18 May 2024 12:07:09 -0700 Subject: [PATCH] Add tests for editing audience rating and critic rating --- tests/test_audio.py | 6 ++++++ tests/test_collection.py | 2 ++ tests/test_mixins.py | 10 +++++++++- tests/test_video.py | 8 ++++++++ 4 files changed, 25 insertions(+), 1 deletion(-) diff --git a/tests/test_audio.py b/tests/test_audio.py index 3c813d3dd..8ebad4f51 100644 --- a/tests/test_audio.py +++ b/tests/test_audio.py @@ -112,6 +112,8 @@ def test_audio_Artist_mixins_rating(artist): def test_audio_Artist_mixins_fields(artist): test_mixins.edit_added_at(artist) + test_mixins.edit_audience_rating(artist) + test_mixins.edit_critic_rating(artist) test_mixins.edit_sort_title(artist) test_mixins.edit_summary(artist) test_mixins.edit_title(artist) @@ -239,6 +241,8 @@ def test_audio_Album_mixins_rating(album): def test_audio_Album_mixins_fields(album): test_mixins.edit_added_at(album) + test_mixins.edit_audience_rating(album) + test_mixins.edit_critic_rating(album) test_mixins.edit_originally_available(album) test_mixins.edit_sort_title(album) test_mixins.edit_studio(album) @@ -422,6 +426,8 @@ def test_audio_Track_mixins_rating(track): def test_audio_Track_mixins_fields(track): test_mixins.edit_added_at(track) + test_mixins.edit_audience_rating(track) + test_mixins.edit_critic_rating(track) test_mixins.edit_title(track) test_mixins.edit_track_artist(track) test_mixins.edit_track_number(track) diff --git a/tests/test_collection.py b/tests/test_collection.py index 362e8a265..6226a5fa7 100644 --- a/tests/test_collection.py +++ b/tests/test_collection.py @@ -366,7 +366,9 @@ def test_Collection_mixins_rating(collection): def test_Collection_mixins_fields(collection): test_mixins.edit_added_at(collection) + test_mixins.edit_audience_rating(collection) test_mixins.edit_content_rating(collection) + test_mixins.edit_critic_rating(collection) test_mixins.edit_sort_title(collection) test_mixins.edit_summary(collection) test_mixins.edit_title(collection) diff --git a/tests/test_mixins.py b/tests/test_mixins.py index 0d111698d..be7409cf6 100644 --- a/tests/test_mixins.py +++ b/tests/test_mixins.py @@ -51,10 +51,18 @@ def edit_added_at(obj): _test_mixins_field(obj, "addedAt", "AddedAt") +def edit_audience_rating(obj): + _test_mixins_field(obj, "audienceRating", "AudienceRating", default=None, value=7.7) + + def edit_content_rating(obj): _test_mixins_field(obj, "contentRating", "ContentRating") +def edit_critic_rating(obj): + _test_mixins_field(obj, "rating", "CriticRating", default=None, value=8.8) + + def edit_edition_title(obj): _test_mixins_field(obj, "editionTitle", "EditionTitle") @@ -104,7 +112,7 @@ def edit_photo_captured_time(obj): def edit_user_rating(obj): - _test_mixins_field(obj, "userRating", "UserRating", default=None, value=10) + _test_mixins_field(obj, "userRating", "UserRating", default=None, value=10.0) def _test_mixins_tag(obj, attr, tag_method): diff --git a/tests/test_video.py b/tests/test_video.py index 040fb2e7c..b25fe4b30 100644 --- a/tests/test_video.py +++ b/tests/test_video.py @@ -689,7 +689,9 @@ def test_video_Movie_mixins_rating(movie): def test_video_Movie_mixins_fields(movie): test_mixins.edit_added_at(movie) + test_mixins.edit_audience_rating(movie) test_mixins.edit_content_rating(movie) + test_mixins.edit_critic_rating(movie) test_mixins.edit_originally_available(movie) test_mixins.edit_original_title(movie) test_mixins.edit_sort_title(movie) @@ -955,7 +957,9 @@ def test_video_Show_mixins_rating(show): def test_video_Show_mixins_fields(show): test_mixins.edit_added_at(show) + test_mixins.edit_audience_rating(show) test_mixins.edit_content_rating(show) + test_mixins.edit_critic_rating(show) test_mixins.edit_originally_available(show) test_mixins.edit_original_title(show) test_mixins.edit_sort_title(show) @@ -1112,6 +1116,8 @@ def test_video_Season_mixins_rating(show): def test_video_Season_mixins_fields(show): season = show.season(season=1) test_mixins.edit_added_at(season) + test_mixins.edit_audience_rating(season) + test_mixins.edit_critic_rating(season) test_mixins.edit_summary(season) test_mixins.edit_title(season) test_mixins.edit_user_rating(season) @@ -1322,7 +1328,9 @@ def test_video_Episode_mixins_rating(episode): def test_video_Episode_mixins_fields(episode): test_mixins.edit_added_at(episode) + test_mixins.edit_audience_rating(episode) test_mixins.edit_content_rating(episode) + test_mixins.edit_critic_rating(episode) test_mixins.edit_originally_available(episode) test_mixins.edit_sort_title(episode) test_mixins.edit_summary(episode)