Skip to content

Commit

Permalink
add ut
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenLYZ authored and zhaoyongjie committed Jan 28, 2022
1 parent 0506ddf commit 7d23b25
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/integration_tests/sqla_models_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,29 @@ def test_values_for_column(self):
)
assert result_object.df["count"][0] == 4

def test_values_in_quotes(self):
table = SqlaTable(
table_name="test_quotes_in_column",
sql=(
"SELECT '\"text in double quotes\"' as name "
"UNION SELECT '''text in single quotes''' "
"UNION SELECT 'double quotes \" in text' "
"UNION SELECT 'single quotes '' in text' "
),
database=get_example_database(),
)
TableColumn(column_name="name", type="VARCHAR(255)", table=table)

rv = table.values_for_column(column_name="name", limit=10000,)

for item in [
'"text in double quotes"',
"'text in single quotes'",
'double quotes " in text',
"single quotes ' in text",
]:
assert item in rv


@pytest.mark.parametrize(
"row,dimension,result",
Expand Down

0 comments on commit 7d23b25

Please sign in to comment.