diff --git a/tests/conftest.py b/tests/conftest.py index 077735cc..f7ca7761 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- import time -import uuid from datetime import datetime from functools import partial from os import environ diff --git a/tools/plex-teardowntest.py b/tools/plex-teardowntest.py index a1e383f9..a47b1537 100755 --- a/tools/plex-teardowntest.py +++ b/tools/plex-teardowntest.py @@ -11,11 +11,21 @@ from plexapi import X_PLEX_IDENTIFIER if __name__ == '__main__': myplex = MyPlexAccount() plex = PlexServer(token=myplex.authenticationToken) + + # Remove the test server for device in plex.myPlexAccount().devices(): if device.clientIdentifier == plex.machineIdentifier: print('Removing device "%s", with id "%s"' % (device.name, device. clientIdentifier)) device.delete() + # Remove the test sync client + sync_client_identifier = 'sync-client-%s' % X_PLEX_IDENTIFIER + for device in plex.myPlexAccount().devices(): + if device.clientIdentifier == sync_client_identifier: + print('Removing device "%s", with id "%s"' % (device.name, device. clientIdentifier)) + device.delete() + break + # If we suddenly remove the client first we wouldn't be able to authenticate to delete the server for device in plex.myPlexAccount().devices(): if device.clientIdentifier == X_PLEX_IDENTIFIER: