Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions tests/integration/standard/column_encryption/test_policies.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ def test_end_to_end_prepared(self):
# A straight select from the database will now return the decrypted bits. We select both encrypted and unencrypted
# values here to confirm that we don't interfere with regular processing of unencrypted vals.
(encrypted,unencrypted) = session.execute("select encrypted, unencrypted from foo.bar where unencrypted = %s allow filtering", (expected,)).one()
self.assertEquals(expected, encrypted)
self.assertEquals(expected, unencrypted)
self.assertEqual(expected, encrypted)
self.assertEqual(expected, unencrypted)

# Confirm the same behaviour from a subsequent prepared statement as well
prepared = session.prepare("select encrypted, unencrypted from foo.bar where unencrypted = ? allow filtering")
(encrypted,unencrypted) = session.execute(prepared, [expected]).one()
self.assertEquals(expected, encrypted)
self.assertEquals(expected, unencrypted)
self.assertEqual(expected, encrypted)
self.assertEqual(expected, unencrypted)

def test_end_to_end_simple(self):

Expand All @@ -86,14 +86,14 @@ def test_end_to_end_simple(self):
# A straight select from the database will now return the decrypted bits. We select both encrypted and unencrypted
# values here to confirm that we don't interfere with regular processing of unencrypted vals.
(encrypted,unencrypted) = session.execute("select encrypted, unencrypted from foo.bar where unencrypted = %s allow filtering", (expected,)).one()
self.assertEquals(expected, encrypted)
self.assertEquals(expected, unencrypted)
self.assertEqual(expected, encrypted)
self.assertEqual(expected, unencrypted)

# Confirm the same behaviour from a subsequent prepared statement as well
prepared = session.prepare("select encrypted, unencrypted from foo.bar where unencrypted = ? allow filtering")
(encrypted,unencrypted) = session.execute(prepared, [expected]).one()
self.assertEquals(expected, encrypted)
self.assertEquals(expected, unencrypted)
self.assertEqual(expected, encrypted)
self.assertEqual(expected, unencrypted)

def test_end_to_end_different_cle_contexts_different_ivs(self):
"""
Expand Down Expand Up @@ -135,8 +135,8 @@ def test_end_to_end_different_cle_contexts_different_ivs(self):
cluster2 = TestCluster(column_encryption_policy=cl_policy2)
session2 = cluster2.connect()
(encrypted,unencrypted) = session2.execute("select encrypted, unencrypted from foo.bar where unencrypted = %s allow filtering", (expected,)).one()
self.assertEquals(expected, encrypted)
self.assertEquals(expected, unencrypted)
self.assertEqual(expected, encrypted)
self.assertEqual(expected, unencrypted)

def test_end_to_end_different_cle_contexts_different_policies(self):
"""
Expand All @@ -161,10 +161,10 @@ def test_end_to_end_different_cle_contexts_different_policies(self):
# A straight select from the database will now return the decrypted bits. We select both encrypted and unencrypted
# values here to confirm that we don't interfere with regular processing of unencrypted vals.
(encrypted,unencrypted) = session2.execute("select encrypted, unencrypted from foo.bar where unencrypted = %s allow filtering", (expected,)).one()
self.assertEquals(cl_policy.encode_and_encrypt(col_desc, expected), encrypted)
self.assertEquals(expected, unencrypted)
self.assertEqual(cl_policy.encode_and_encrypt(col_desc, expected), encrypted)
self.assertEqual(expected, unencrypted)

# Confirm the same behaviour from a subsequent prepared statement as well
prepared = session2.prepare("select encrypted, unencrypted from foo.bar where unencrypted = ? allow filtering")
(encrypted,unencrypted) = session2.execute(prepared, [expected]).one()
self.assertEquals(cl_policy.encode_and_encrypt(col_desc, expected), encrypted)
self.assertEqual(cl_policy.encode_and_encrypt(col_desc, expected), encrypted)