Skip to content

Commit 8f96c34

Browse files
committed
add test for checking _allowMediaDeletion method.
1 parent ba75935 commit 8f96c34

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/test_server.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,3 +269,15 @@ def test_server_downloadLogs(tmpdir, plex):
269269
def test_server_downloadDatabases(tmpdir, plex):
270270
plex.downloadDatabases(savepath=str(tmpdir), unpack=True)
271271
assert len(tmpdir.listdir()) > 1
272+
273+
def test_server_allowMediaDeletion(account):
274+
plex = PlexServer(utils.SERVER_BASEURL, account.authenticationToken)
275+
plex._allowMediaDeletion(True)
276+
time.sleep(1)
277+
plex = PlexServer(utils.SERVER_BASEURL, account.authenticationToken)
278+
assert plex.allowMediaDeletion == True
279+
plex = PlexServer(utils.SERVER_BASEURL, account.authenticationToken)
280+
plex._allowMediaDeletion(False)
281+
time.sleep(1)
282+
plex = PlexServer(utils.SERVER_BASEURL, account.authenticationToken)
283+
assert plex.allowMediaDeletion == None

0 commit comments

Comments
 (0)