|
4 | 4 | from urllib.parse import quote_plus |
5 | 5 |
|
6 | 6 | import pytest |
| 7 | +import plexapi.base |
7 | 8 | from plexapi.exceptions import BadRequest, NotFound |
8 | 9 | from plexapi.sync import VIDEO_QUALITY_3_MBPS_720p |
9 | 10 |
|
@@ -957,6 +958,30 @@ def test_video_Show_isPlayed(show): |
957 | 958 | assert not show.isPlayed |
958 | 959 |
|
959 | 960 |
|
| 961 | +def test_video_Show_season_guids(show): |
| 962 | + plexapi.base.USER_DONT_RELOAD_FOR_KEYS.add('guids') |
| 963 | + try: |
| 964 | + season = show.season("Season 1") |
| 965 | + assert season.guids |
| 966 | + seasons = show.seasons() |
| 967 | + assert len(seasons) > 0 |
| 968 | + assert seasons[0].guids |
| 969 | + finally: |
| 970 | + plexapi.base.USER_DONT_RELOAD_FOR_KEYS.remove('guids') |
| 971 | + |
| 972 | + |
| 973 | +def test_video_Show_episode_guids(show): |
| 974 | + plexapi.base.USER_DONT_RELOAD_FOR_KEYS.add('guids') |
| 975 | + try: |
| 976 | + episode = show.episode("Winter Is Coming") |
| 977 | + assert episode.guids |
| 978 | + episodes = show.episodes() |
| 979 | + assert len(episodes) > 0 |
| 980 | + assert episodes[0].guids |
| 981 | + finally: |
| 982 | + plexapi.base.USER_DONT_RELOAD_FOR_KEYS.remove('guids') |
| 983 | + |
| 984 | + |
960 | 985 | def test_video_Show_section(show): |
961 | 986 | section = show.section() |
962 | 987 | assert section.title == "TV Shows" |
@@ -1142,6 +1167,7 @@ def test_video_Season_show(show): |
1142 | 1167 | season_by_name = show.season("Season 1") |
1143 | 1168 | assert show.ratingKey == season.parentRatingKey and season_by_name.parentRatingKey |
1144 | 1169 | assert season.ratingKey == season_by_name.ratingKey |
| 1170 | + assert season.guids |
1145 | 1171 |
|
1146 | 1172 |
|
1147 | 1173 | def test_video_Season_watched(show): |
@@ -1178,6 +1204,29 @@ def test_video_Season_episode(show): |
1178 | 1204 | def test_video_Season_episodes(show): |
1179 | 1205 | episodes = show.season("Season 2").episodes() |
1180 | 1206 | assert len(episodes) >= 1 |
| 1207 | + |
| 1208 | + |
| 1209 | +def test_video_Season_episode_guids(show): |
| 1210 | + plexapi.base.USER_DONT_RELOAD_FOR_KEYS.add('guids') |
| 1211 | + try: |
| 1212 | + season = show.season("Season 1") |
| 1213 | + episode = season.episode("Winter Is Coming") |
| 1214 | + assert episode.guids |
| 1215 | + episodes = season.episodes() |
| 1216 | + assert len(episodes) > 0 |
| 1217 | + assert episodes[0].guids |
| 1218 | + finally: |
| 1219 | + plexapi.base.USER_DONT_RELOAD_FOR_KEYS.remove('guids') |
| 1220 | + |
| 1221 | + |
| 1222 | +def test_video_Season_show_guids(show): |
| 1223 | + plexapi.base.USER_DONT_RELOAD_FOR_KEYS.add('guids') |
| 1224 | + try: |
| 1225 | + a_show = show.season("Season 1").show() |
| 1226 | + assert a_show |
| 1227 | + assert 'tmdb://1399' in [i.id for i in a_show.guids] |
| 1228 | + finally: |
| 1229 | + plexapi.base.USER_DONT_RELOAD_FOR_KEYS.remove('guids') |
1181 | 1230 |
|
1182 | 1231 |
|
1183 | 1232 | @pytest.mark.xfail(reason="Changing images fails randomly") |
@@ -1250,6 +1299,31 @@ def test_video_Episode(show): |
1250 | 1299 | show.episode(season=1337, episode=1337) |
1251 | 1300 |
|
1252 | 1301 |
|
| 1302 | +def test_video_Episode_parent_guids(show): |
| 1303 | + plexapi.base.USER_DONT_RELOAD_FOR_KEYS.add('guids') |
| 1304 | + try: |
| 1305 | + episodes = show.episodes() |
| 1306 | + assert episodes |
| 1307 | + episode = episodes[0] |
| 1308 | + assert episode |
| 1309 | + assert episode.isPartialObject() |
| 1310 | + season = episode._season |
| 1311 | + assert season |
| 1312 | + assert season.isPartialObject() |
| 1313 | + assert season.guids |
| 1314 | + season = episode.season() |
| 1315 | + assert season |
| 1316 | + assert season.isPartialObject() |
| 1317 | + assert season.guids |
| 1318 | + show = episode.show() |
| 1319 | + assert show |
| 1320 | + assert show.isPartialObject() |
| 1321 | + assert show.guids |
| 1322 | + finally: |
| 1323 | + plexapi.base.USER_DONT_RELOAD_FOR_KEYS.remove('guids') |
| 1324 | + |
| 1325 | + |
| 1326 | + |
1253 | 1327 | def test_video_Episode_hidden_season(episode): |
1254 | 1328 | assert episode.skipParent is False |
1255 | 1329 | assert episode.parentRatingKey |
|
0 commit comments