def test_gen_key(self, keymanager_mock): # given keyman = keymanager_mock.return_value keyman.get_key.side_effect = KeyNotFound nicknym = NickNym(self.provider, self.config, self.soledad_session, self.srp_session) # when/then nicknym.generate_openpgp_key() keyman.get_key.assert_called_with('*****@*****.**', openpgp.OpenPGPKey, fetch_remote=False, private=True) keyman.gen_key.assert_called_with(openpgp.OpenPGPKey)
def test_gen_key(self, keymanager_mock): # given keyman = keymanager_mock.return_value keyman.get_key.side_effect = KeyNotFound nicknym = NickNym( self.provider, self.config, self.soledad, "*****@*****.**", self.auth.token, self.auth.uuid ) # when/then nicknym.generate_openpgp_key() keyman.get_key.assert_called_with("*****@*****.**", private=True, fetch_remote=False) keyman.gen_key.assert_called()
def test_gen_key(self, keymanager_mock): # given keyman = keymanager_mock.return_value keyman.get_key.side_effect = KeyNotFound nicknym = NickNym(self.provider, self.config, self.soledad, '*****@*****.**', self.auth.token, self.auth.uuid) # when/then nicknym.generate_openpgp_key() keyman.get_key.assert_called_with('*****@*****.**', private=True, fetch_remote=False) keyman.gen_key.assert_called()
def test_that_keymanager_is_created(self, init_mock): # given # when NickNym(self.provider, self.config, self.soledad_session, self.srp_session) # then init_mock.assert_called_with('*****@*****.**', 'https://nicknym.some-server.test:6425/', self.soledad, self.token, '/some/path/to/ca_cert', 'https://api.some-server.test:4430', '1', self.uuid, '/path/to/gpg')
def test_that_keymanager_is_created(self, keymanager_mock): # given LeapCertificate.provider_api_cert = '/some/path/to/provider_ca_cert' # when NickNym(self.provider, self.config, self.soledad, '*****@*****.**', self.auth.token, self.auth.uuid) # then keymanager_mock.assert_called_with( '*****@*****.**', 'https://nicknym.some-server.test:6425/', self.soledad, token=self.auth.token, ca_cert_path='/some/path/to/provider_ca_cert', api_uri='https://api.some-server.test:4430', api_version='1', uid=self.auth.uuid, gpgbinary='/path/to/gpg')