Skip to content

Commit 47e4c9d

Browse files
committed
more tests
1 parent baf655b commit 47e4c9d

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

tests/test_library.py

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,8 @@ def test_library_section_get_movie(plex):
4545
assert plex.library.section('Movies').get('Sita Sings the Blues')
4646

4747

48-
def test_library_section_delete(monkeypatch, movies):
49-
monkeypatch.delattr("requests.sessions.Session.request")
50-
try:
51-
movies.delete()
52-
except AttributeError:
53-
# will always raise because there is no request
54-
pass
48+
def test_library_section_delete(movies, patched_http_call):
49+
movies.delete()
5550

5651

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

7166

72-
def test_library_search(plex):
73-
item = plex.library.search('Elephants Dream')[0]
74-
assert item.title == 'Elephants Dream'
75-
76-
7767
def test_library_add_edit_delete(plex):
7868
# Dont add a location to prevent scanning scanning
7969
section_name = 'plexapi_test_section'
@@ -115,14 +105,28 @@ def test_library_Library_deleteMediaPreviews(plex):
115105
plex.library.deleteMediaPreviews()
116106

117107

118-
def _test_library_MovieSection_refresh(movies):
119-
movies.refresh()
108+
def test_library_Library_all(plex):
109+
assert len(plex.library.all(title__iexact='The 100'))
110+
111+
112+
def test_library_Library_search(plex):
113+
item = plex.library.search('Elephants Dream')[0]
114+
assert item.title == 'Elephants Dream'
115+
assert len(plex.library.search(libtype='episode'))
120116

121117

122118
def test_library_MovieSection_update(movies):
123119
movies.update()
124120

125121

122+
def test_library_ShowSection_all(tvshows):
123+
assert len(tvshows.all(title__iexact='The 100'))
124+
125+
126+
def test_library_MovieSection_refresh(movies, patched_http_call):
127+
movies.refresh()
128+
129+
126130
def test_library_MovieSection_search_genre(movie, movies):
127131
# assert len(movie.genres[0].items()) # TODO
128132
assert len(movies.search(genre=movie.genres[0])) > 1

0 commit comments

Comments
 (0)