mirror of
https://github.com/pkkid/python-plexapi
synced 2024-11-10 14:14:19 +00:00
Fix tests
Should we just remove the cache and require that the user reloads this? or i can reload in the tests.
This commit is contained in:
parent
ef0556f952
commit
8910a307f9
2 changed files with 14 additions and 5 deletions
|
@ -66,24 +66,32 @@ class Playlist(PlexPartialObject, Playable):
|
|||
key = '%s/items%s' % (self.key, utils.joinArgs({
|
||||
'uri': 'library://%s/directory//library/metadata/%s' % (uuid, ratingKeys)
|
||||
}))
|
||||
return self._server.query(key, method=self._server._session.put)
|
||||
result = self._server.query(key, method=self._server._session.put)
|
||||
self.reload()
|
||||
return result
|
||||
|
||||
def removeItem(self, item):
|
||||
""" Remove a file from a playlist. """
|
||||
key = '%s/items/%s' % (self.key, item.playlistItemID)
|
||||
return self._server.query(key, method=self._server._session.delete)
|
||||
result = self._server.query(key, method=self._server._session.delete)
|
||||
self.reload()
|
||||
return result
|
||||
|
||||
def moveItem(self, item, after=None):
|
||||
""" Move a to a new position in playlist. """
|
||||
key = '%s/items/%s/move' % (self.key, item.playlistItemID)
|
||||
if after:
|
||||
key += '?after=%s' % after.playlistItemID
|
||||
return self._server.query(key, method=self._server._session.put)
|
||||
result = self._server.query(key, method=self._server._session.put)
|
||||
self.reload()
|
||||
return result
|
||||
|
||||
def edit(self, title=None, summary=None):
|
||||
""" Edit playlist. """
|
||||
key = '/library/metadata/%s%s' % (self.ratingKey, utils.joinArgs({'title': title, 'summary': summary}))
|
||||
return self._server.query(key, method=self._server._session.put)
|
||||
result = self._server.query(key, method=self._server._session.put)
|
||||
self.reload()
|
||||
return result
|
||||
|
||||
def delete(self):
|
||||
""" Delete playlist. """
|
||||
|
|
|
@ -233,7 +233,8 @@ def test_server_account(plex):
|
|||
assert account.signInState == 'ok'
|
||||
assert isinstance(account.subscriptionActive, bool)
|
||||
if account.subscriptionActive: assert len(account.subscriptionFeatures)
|
||||
else: assert sorted(account.subscriptionFeatures) == ['download_certificates', 'federated-auth', 'news']
|
||||
else: assert sorted(account.subscriptionFeatures) == ['adaptive_bitrate', 'download_certificates',
|
||||
'federated-auth', 'news']
|
||||
assert account.subscriptionState == 'Active' if account.subscriptionActive else 'Unknown'
|
||||
assert re.match(utils.REGEX_EMAIL, account.username)
|
||||
|
||||
|
|
Loading…
Reference in a new issue