diff options
author | drebs <drebs@leap.se> | 2013-02-13 12:45:53 -0200 |
---|---|---|
committer | drebs <drebs@leap.se> | 2013-02-13 12:45:53 -0200 |
commit | ecf568431319b4e81bc077141048d0b7f1e0964d (patch) | |
tree | c3b2fe3e6aea128ec8fc2630547bfc5077d36d23 /tests/test_sqlcipher.py | |
parent | b056db0ad84af10d3d6368ea3e93f23f0f3251a9 (diff) |
Refactor and fix tests.
Diffstat (limited to 'tests/test_sqlcipher.py')
-rw-r--r-- | tests/test_sqlcipher.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/test_sqlcipher.py b/tests/test_sqlcipher.py index 4c0451b3..7b8f6298 100644 --- a/tests/test_sqlcipher.py +++ b/tests/test_sqlcipher.py @@ -450,20 +450,26 @@ class SQLCipherSyncTargetTests(test_sync.DatabaseSyncTargetTests): #----------------------------------------------------------------------------- class SQLCipherEncryptionTest(BaseLeapTest): + """ + Tests to guarantee SQLCipher is indeed encrypting data when storing. + """ - def delete_dbfiles(self): + def _delete_dbfiles(self): for dbfile in [self.DB_FILE]: if os.path.exists(dbfile): os.unlink(dbfile) def setUp(self): self.DB_FILE = self.tempdir + '/test.db' - self.delete_dbfiles() + self._delete_dbfiles() def tearDown(self): - self.delete_dbfiles() + self._delete_dbfiles() def test_try_to_open_encrypted_db_with_sqlite_backend(self): + """ + SQLite backend should not succeed to open SQLCipher databases. + """ db = SQLCipherDatabase(self.DB_FILE, PASSWORD) doc = db.create_doc_from_json(tests.simple_doc) db.close() @@ -483,6 +489,9 @@ class SQLCipherEncryptionTest(BaseLeapTest): 'decrypted content mismatch') def test_try_to_open_raw_db_with_sqlcipher_backend(self): + """ + SQLCipher backend should not succeed to open unencrypted databases. + """ db = SQLitePartialExpandDatabase(self.DB_FILE, document_factory=LeapDocument) db.create_doc_from_json(tests.simple_doc) |