Skip to content

Commit

Permalink
more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Hellowlol committed Oct 28, 2017
1 parent baf655b commit 47e4c9d
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions tests/test_library.py
Expand Up @@ -45,13 +45,8 @@ def test_library_section_get_movie(plex):
assert plex.library.section('Movies').get('Sita Sings the Blues')


def test_library_section_delete(monkeypatch, movies):
monkeypatch.delattr("requests.sessions.Session.request")
try:
movies.delete()
except AttributeError:
# will always raise because there is no request
pass
def test_library_section_delete(movies, patched_http_call):
movies.delete()


def test_library_fetchItem(plex, movie):
Expand All @@ -69,11 +64,6 @@ def test_library_recentlyAdded(plex):
assert len(list(plex.library.recentlyAdded()))


def test_library_search(plex):
item = plex.library.search('Elephants Dream')[0]
assert item.title == 'Elephants Dream'


def test_library_add_edit_delete(plex):
# Dont add a location to prevent scanning scanning
section_name = 'plexapi_test_section'
Expand Down Expand Up @@ -115,14 +105,28 @@ def test_library_Library_deleteMediaPreviews(plex):
plex.library.deleteMediaPreviews()


def _test_library_MovieSection_refresh(movies):
movies.refresh()
def test_library_Library_all(plex):
assert len(plex.library.all(title__iexact='The 100'))


def test_library_Library_search(plex):
item = plex.library.search('Elephants Dream')[0]
assert item.title == 'Elephants Dream'
assert len(plex.library.search(libtype='episode'))


def test_library_MovieSection_update(movies):
movies.update()


def test_library_ShowSection_all(tvshows):
assert len(tvshows.all(title__iexact='The 100'))


def test_library_MovieSection_refresh(movies, patched_http_call):
movies.refresh()


def test_library_MovieSection_search_genre(movie, movies):
# assert len(movie.genres[0].items()) # TODO
assert len(movies.search(genre=movie.genres[0])) > 1
Expand Down

0 comments on commit 47e4c9d

Please sign in to comment.