Add wrong password test

This commit is contained in:
nolash
2020-08-05 19:54:19 +02:00
parent a845aecda1
commit fa7b3ca774
2 changed files with 4 additions and 7 deletions

View File

@@ -6,7 +6,7 @@ import base64
import psycopg2
from psycopg2 import sql
from cryptography.fernet import Fernet
from cryptography.fernet import Fernet, InvalidToken
from keystore import ReferenceDatabase
@@ -52,8 +52,9 @@ class TestDatabase(unittest.TestCase):
def test_get_key(self):
pk = self.db.get(self.address_hex, 'foo')
logg.info('pk {}'.format(pk.hex()))
self.db.get(self.address_hex, 'foo')
with self.assertRaises(InvalidToken):
self.db.get(self.address_hex, 'bar')
if __name__ == '__main__':