Skip to content

Commit

Permalink
Add tests for metadataDirectory and resourceFilepath
Browse files Browse the repository at this point in the history
  • Loading branch information
JonnyWong16 committed Aug 2, 2023
1 parent 26da587 commit b3b5de4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@
STUB_MOVIE_PATH = os.path.join(BASE_DIR_PATH, "tests", "data", "video_stub.mp4")
STUB_MP3_PATH = os.path.join(BASE_DIR_PATH, "tests", "data", "audio_stub.mp3")
STUB_IMAGE_PATH = os.path.join(BASE_DIR_PATH, "tests", "data", "cute_cat.jpg")
# For the default Docker bootstrap test Plex Media Server data directory
BOOTSTRAP_DATA_PATH = os.path.join(BASE_DIR_PATH, "plex", "db", "Library", "Application Support", "Plex Media Server")


def pytest_addoption(parser):
Expand Down
12 changes: 12 additions & 0 deletions tests/test_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -1459,3 +1459,15 @@ def test_video_optimize(plex, movie, tvshows, show):
movie.optimize()
with pytest.raises(BadRequest):
movie.optimize(target="mobile", locationID=-100)


def test_video_Movie_matadataDirectory(movie):
assert os.path.exists(os.path.join(utils.BOOTSTRAP_DATA_PATH, movie.metadataDirectory))

for poster in movie.posters():
if not poster.ratingKey.startswith('http'):
assert os.path.exists(os.path.join(utils.BOOTSTRAP_DATA_PATH, poster.resourceFilepath))

for art in movie.arts():
if not art.ratingKey.startswith('http'):
assert os.path.exists(os.path.join(utils.BOOTSTRAP_DATA_PATH, art.resourceFilepath))

0 comments on commit b3b5de4

Please sign in to comment.