Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanuel-keller committed Feb 7, 2025
1 parent 092cdf5 commit 666f1c8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
3 changes: 2 additions & 1 deletion tests/unit_tests/connections/insert/test_async_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ async def test_insert_record_id_result_error(self):

with self.assertRaises(Exception) as context:
_ = await self.connection.insert(record_id, self.insert_data)
e = str(context.exception)
self.assertEqual(
"There was a problem with the database: Can not execute INSERT statement using value: user:tobie" in str(context.exception),
"There was a problem with the database: Can not execute INSERT statement using value" in e and "user:tobie" in e,
True
)
await self.connection.query("DELETE user;")
Expand Down
3 changes: 2 additions & 1 deletion tests/unit_tests/connections/insert/test_async_ws.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ async def test_insert_record_id_result_error(self):

with self.assertRaises(Exception) as context:
_ = await self.connection.insert(record_id, self.insert_data)
e = str(context.exception)
self.assertEqual(
"There was a problem with the database: Can not execute INSERT statement using value: user:tobie" in str(context.exception),
"There was a problem with the database: Can not execute INSERT statement using value" in e and "user:tobie" in e,
True
)
await self.connection.query("DELETE user;")
Expand Down
6 changes: 4 additions & 2 deletions tests/unit_tests/connections/insert/test_blocking_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@ def test_insert_record_id_result_error(self):

with self.assertRaises(Exception) as context:
_ = self.connection.insert(record_id, self.insert_data)
self.assertTrue(
"There was a problem with the database: Can not execute INSERT statement using value: user:tobie" in str(context.exception)
e = str(context.exception)
self.assertEqual(
"There was a problem with the database: Can not execute INSERT statement using value" in e and "user:tobie" in e,
True
)
self.connection.query("DELETE user;")

Expand Down
7 changes: 4 additions & 3 deletions tests/unit_tests/connections/insert/test_blocking_ws.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ def test_insert_record_id_result_error(self):

with self.assertRaises(Exception) as context:
_ = self.connection.insert(record_id, self.insert_data)
self.assertTrue(
"There was a problem with the database: Can not execute INSERT statement using value: user:tobie"
in str(context.exception)
e = str(context.exception)
self.assertEqual(
"There was a problem with the database: Can not execute INSERT statement using value" in e and "user:tobie" in e,
True
)


Expand Down

0 comments on commit 666f1c8

Please sign in to comment.