コード例 #1
0
ファイル: test_cursor.py プロジェクト: codeaudit/pymapd
 def test_escape_malicious(self):
     query = "select * from foo where bar > :baz"
     result = str(_bind_parameters(query, {"baz": '1; drop table foo'}))
     # note the inner quotes
     expected = "select * from foo where bar > '1; drop table foo'"
     assert result == expected
コード例 #2
0
ファイル: test_cursor.py プロジェクト: codeaudit/pymapd
 def test_escape_basic(self):
     query = "select * from foo where bar > :baz"
     result = str(_bind_parameters(query, {"baz": 10}))
     expected = 'select * from foo where bar > 10'
     assert result == expected