Merge pull request #187 from ndbroadbent/override_client_id

Allow client_id to be overridden in __init__ (for replayable HTTP requests in pyvcr tests)
This commit is contained in:
Adam Coddington 2018-12-12 19:07:02 -08:00 committed by GitHub
commit c63e63bd82
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -134,13 +134,14 @@ class PyiCloudService(object):
"""
def __init__(
self, apple_id, password=None, cookie_directory=None, verify=True
self, apple_id, password=None, cookie_directory=None, verify=True,
client_id=None
):
if password is None:
password = get_password_from_keyring(apple_id)
self.data = {}
self.client_id = str(uuid.uuid1()).upper()
self.client_id = client_id or str(uuid.uuid1()).upper()
self.user = {'apple_id': apple_id, 'password': password}
self._password_filter = PyiCloudPasswordFilter(password)