From 14f39a4b46e227fd6743fe7c214c16a75278c1f5 Mon Sep 17 00:00:00 2001 From: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> Date: Sat, 21 Nov 2020 18:16:37 -0800 Subject: [PATCH] Improve server browse tests --- tests/test_server.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/test_server.py b/tests/test_server.py index 5038d606..03d35b21 100644 --- a/tests/test_server.py +++ b/tests/test_server.py @@ -288,12 +288,20 @@ def test_server_downloadDatabases(tmpdir, plex): def test_server_browse(plex, movies): + movies_path = movies.locations[0] # browse root paths = plex.browse() assert len(paths) - # browse of the files of the movie lib. - for path, paths, files in plex.walk(movies.locations[0]): - assert len(files) + # browse the path of the movie library + paths = plex.browse(movies_path) + assert len(paths) + # browse the path of the movie library without files + paths = plex.browse(movies_path, includeFiles=False) + assert not len([f for f in paths if f.TAG == 'File']) + # walk the path of the movie library + for path, paths, files in plex.walk(movies_path): + assert path.startswith(movies_path) + assert len(paths) or len(files) def test_server_allowMediaDeletion(account):