Allow client_id to be overridden in __init__ (for replayable HTTP requests in pyvcr tests)
This commit is contained in:
parent
3899363167
commit
602ef0fbf5
1 changed files with 3 additions and 2 deletions
|
@ -134,13 +134,14 @@ class PyiCloudService(object):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(
|
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:
|
if password is None:
|
||||||
password = get_password_from_keyring(apple_id)
|
password = get_password_from_keyring(apple_id)
|
||||||
|
|
||||||
self.data = {}
|
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.user = {'apple_id': apple_id, 'password': password}
|
||||||
|
|
||||||
self._password_filter = PyiCloudPasswordFilter(password)
|
self._password_filter = PyiCloudPasswordFilter(password)
|
||||||
|
|
Loading…
Reference in a new issue