Skip to content

Commit 14f39a4

Browse files
committed
Improve server browse tests
1 parent 0450cd1 commit 14f39a4

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

tests/test_server.py

+11-3
Original file line numberDiff line numberDiff line change
@@ -288,12 +288,20 @@ def test_server_downloadDatabases(tmpdir, plex):
288288

289289

290290
def test_server_browse(plex, movies):
291+
movies_path = movies.locations[0]
291292
# browse root
292293
paths = plex.browse()
293294
assert len(paths)
294-
# browse of the files of the movie lib.
295-
for path, paths, files in plex.walk(movies.locations[0]):
296-
assert len(files)
295+
# browse the path of the movie library
296+
paths = plex.browse(movies_path)
297+
assert len(paths)
298+
# browse the path of the movie library without files
299+
paths = plex.browse(movies_path, includeFiles=False)
300+
assert not len([f for f in paths if f.TAG == 'File'])
301+
# walk the path of the movie library
302+
for path, paths, files in plex.walk(movies_path):
303+
assert path.startswith(movies_path)
304+
assert len(paths) or len(files)
297305

298306

299307
def test_server_allowMediaDeletion(account):

0 commit comments

Comments
 (0)