Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
betodealmeida committed Apr 29, 2024
1 parent 9d490c8 commit 679cb47
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/db/test_cursor.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,11 @@ def test_names_with_underscores(self, requests_post_mock):

def test_apply_parameters(self):
self.assertEqual(
apply_parameters('SELECT 100 AS "100%"', None), 'SELECT 100 AS "100%"'
apply_parameters('SELECT 100 AS "100%%"', None), 'SELECT 100 AS "100%"'
)

self.assertEqual(
apply_parameters('SELECT 100 AS "100%"', {}), 'SELECT 100 AS "100%"'
apply_parameters('SELECT 100 AS "100%%"', {}), 'SELECT 100 AS "100%"'
)

self.assertEqual(
Expand All @@ -147,6 +147,11 @@ def test_apply_parameters(self):
apply_parameters("SELECT %(key)s", {"key": False}), "SELECT FALSE"
)

self.assertEqual(
apply_parameters("SELECT * FROM t WHERE name LIKE '%%a'", None),
"SELECT * FROM t WHERE name LIKE '%a'",
)


if __name__ == "__main__":
unittest.main()

0 comments on commit 679cb47

Please sign in to comment.