diff options
author | Caio Carrara <ccarrara@thoughtworks.com> | 2016-04-14 22:12:53 -0300 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2016-05-23 20:47:45 -0400 |
commit | 66e3572959774449d4efca5b72efe41af54075e7 (patch) | |
tree | e0d01fa98fa91b9511992ad2ad4006f5c9ad989d /common | |
parent | 21dbbc534be2c4668011cc9e631a7e4ba24061fa (diff) |
[refactor] remove user_id argument from Soledad init
The constructor method of Soledad was receiving two arguments for user
id. One of them was optional with None as default. It could cause an
inconsistent state with uuid set but userid unset.
This change remove the optional user_id argument from initialization
method and return the uuid if anyone call Soledad.userid method.
Diffstat (limited to 'common')
-rw-r--r-- | common/src/leap/soledad/common/tests/test_soledad.py | 3 | ||||
-rw-r--r-- | common/src/leap/soledad/common/tests/util.py | 6 |
2 files changed, 3 insertions, 6 deletions
diff --git a/common/src/leap/soledad/common/tests/test_soledad.py b/common/src/leap/soledad/common/tests/test_soledad.py index bf59ef8a..b48915eb 100644 --- a/common/src/leap/soledad/common/tests/test_soledad.py +++ b/common/src/leap/soledad/common/tests/test_soledad.py @@ -249,8 +249,7 @@ class SoledadSignalingTestCase(BaseSoledadTest): # get a fresh instance so it emits all bootstrap signals sol = self._soledad_instance( secrets_path='alternative_stage3.json', - local_db_path='alternative_stage3.u1db', - userid=ADDRESS) + local_db_path='alternative_stage3.u1db') # reverse call order so we can verify in the order the signals were # expected soledad.client.secrets.events.emit_async.mock_calls.reverse() diff --git a/common/src/leap/soledad/common/tests/util.py b/common/src/leap/soledad/common/tests/util.py index b3a08369..c681fa93 100644 --- a/common/src/leap/soledad/common/tests/util.py +++ b/common/src/leap/soledad/common/tests/util.py @@ -284,8 +284,7 @@ class BaseSoledadTest(BaseLeapTest, MockedSharedDBTest): server_url='https://127.0.0.1/', cert_file=None, shared_db_class=None, - auth_token='auth-token', - userid=ADDRESS): + auth_token='auth-token'): def _put_doc_side_effect(doc): self._doc_put = doc @@ -307,8 +306,7 @@ class BaseSoledadTest(BaseLeapTest, MockedSharedDBTest): cert_file=cert_file, defer_encryption=self.defer_sync_encryption, shared_db=MockSharedDB(), - auth_token=auth_token, - userid=userid) + auth_token=auth_token) self.addCleanup(soledad.close) return soledad |