Skip to content

Commit

Permalink
Add test for parameter with space in its name
Browse files Browse the repository at this point in the history
  • Loading branch information
denisenkom committed Nov 12, 2023
1 parent e3a1dea commit 2d6bfda
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/connected_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -786,3 +786,12 @@ def test_param_as_column_backward_compat(cursor):
param = Column(type=BitType(), value=True)
result = cursor.execute_scalar('select %s', [param])
assert result is True


def test_param_with_spaces(cursor):
"""
For backward compatibility need to support passing parameters as Column objects
New way to pass such parameters is to use Param object.
"""
result = cursor.execute_scalar('select %(param name)s', {"param name": "abc"})
assert result == "abc"

0 comments on commit 2d6bfda

Please sign in to comment.