summaryrefslogtreecommitdiff
path: root/testing/tests/client/test_secrets.py
diff options
context:
space:
mode:
authordrebs <drebs@leap.se>2017-02-25 08:53:38 -0300
committerdrebs <drebs@leap.se>2017-02-25 08:53:38 -0300
commitb433c1ed736f5d4c19da4cdb21108a02459ca7fd (patch)
tree57058c396516dd1c63ad5dd40f7c8fc713c5e496 /testing/tests/client/test_secrets.py
parenta2e29d8bebbe7809dc10195982a205ed3709459c (diff)
[refactor] pass soledad object to client secrets api
In order to be able to change passphrase, token and offline status of soledad from the bitmask client api, the secrets api also has to be able to use up-to-date values when encrypting/decrypting secrets and uploading/downloading them to the server. This commit makes public some soledad attributes that were previously "private" (i.e. used to start with "_" and were not meant to be accessed from outside), and passes the whole soledad object to the client secrets api. This makes the code cleaner and also allows for always getting newest values of soledad attributes.
Diffstat (limited to 'testing/tests/client/test_secrets.py')
-rw-r--r--testing/tests/client/test_secrets.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/testing/tests/client/test_secrets.py b/testing/tests/client/test_secrets.py
index bbeb1fc2..18ff458b 100644
--- a/testing/tests/client/test_secrets.py
+++ b/testing/tests/client/test_secrets.py
@@ -121,12 +121,10 @@ class SecretsCryptoTestCase(unittest.TestCase):
}
def setUp(self):
- def _get_pass():
- return '123'
- self._crypto = SecretsCrypto(_get_pass)
-
- def test__get_pass(self):
- self.assertEqual(self._crypto._get_pass(), '123')
+ class Soledad(object):
+ passphrase = '123'
+ soledad = Soledad()
+ self._crypto = SecretsCrypto(soledad)
def test__get_key(self):
salt = 'abc'