diff --git a/tests/test_security.py b/tests/test_security.py index 4448d5db..e4f49d90 100644 --- a/tests/test_security.py +++ b/tests/test_security.py @@ -119,14 +119,16 @@ def test_security_wallet_field_encryption_password(self): self.assertNotEqual(encrypted_main_key_private, HDKey(pk).private_byte) def test_security_encrypted_db_incorrect_password(self): + if not(os.environ.get('DB_FIELD_ENCRYPTION_PASSWORD') or os.environ.get('DB_FIELD_ENCRYPTION_KEY')): + self.skipTest("This test only runs when no encryption keys are provided") db = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'bitcoinlib_encrypted.db') self.assertRaisesRegex(EncodingError, "Could not decrypt value \(password incorrect\?\): MAC check failed", Wallet, 'wlt-encryption-test', db_uri=db) def test_security_encrypted_db_no_password(self): - db = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'bitcoinlib_encrypted.db') if os.environ.get('DB_FIELD_ENCRYPTION_PASSWORD') or os.environ.get('DB_FIELD_ENCRYPTION_KEY'): self.skipTest("This test only runs when no encryption keys are provided") + db = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'bitcoinlib_encrypted.db') self.assertRaisesRegex(ValueError, "Data is encrypted please provide key in environment", Wallet, 'wlt-encryption-test', db_uri=db)