예제 #1
0
파일: utils_tests.py 프로젝트: vrs/alot
 def test_get_no_keys(self):
     ui = utilities.make_ui()
     envelope = Envelope()
     envelope['To'] = '*****@*****.**'
     yield utils.set_encrypt(ui, envelope)
     self.assertFalse(envelope.encrypt)
     self.assertEqual(envelope.encrypt_keys, {})
예제 #2
0
 def test_get_partial_keys(self):
     ui = mock.Mock()
     envelope = Envelope()
     envelope['Cc'] = '[email protected], [email protected]'
     yield utils.set_encrypt(ui, envelope)
     self.assertTrue(envelope.encrypt)
     self.assertEqual([f.fpr for f in envelope.encrypt_keys.itervalues()],
                      [crypto.get_key(FPR).fpr])
예제 #3
0
파일: utils_tests.py 프로젝트: tomyl/alot
 def test_get_partial_keys(self):
     ui = utilities.make_ui()
     envelope = Envelope()
     envelope['Cc'] = '[email protected], [email protected]'
     yield utils.set_encrypt(ui, envelope)
     self.assertTrue(envelope.encrypt)
     self.assertEqual(
         [f.fpr for f in envelope.encrypt_keys.itervalues()],
         [crypto.get_key(FPR).fpr])
예제 #4
0
파일: utils_tests.py 프로젝트: vrs/alot
 def test_get_keys_from_cc(self):
     ui = utilities.make_ui()
     envelope = Envelope()
     envelope['Cc'] = '[email protected], [email protected]'
     yield utils.set_encrypt(ui, envelope)
     self.assertTrue(envelope.encrypt)
     self.assertEqual(
         [f.fpr for f in envelope.encrypt_keys.itervalues()],
         [crypto.get_key(FPR).fpr, crypto.get_key(EXTRA_FPRS[0]).fpr])
예제 #5
0
파일: utils_tests.py 프로젝트: vrs/alot
 def test_encrypt_to_self_false(self):
     ui = utilities.make_ui()
     envelope = Envelope()
     envelope['From'] = '*****@*****.**'
     envelope['To'] = '*****@*****.**'
     gpg_key = crypto.get_key(FPR)
     account = _Account(encrypt_to_self=False, gpg_key=gpg_key)
     with mock.patch('alot.commands.thread.settings.get_account_by_address',
                     mock.Mock(return_value=account)):
         yield utils.set_encrypt(ui, envelope)
     self.assertTrue(envelope.encrypt)
     self.assertNotIn(FPR, envelope.encrypt_keys)