MCPcopy Create free account
hub / github.com/PyMySQL/PyMySQL / test_escape_nested_sequence

Method test_escape_nested_sequence

pymysql/tests/test_connection.py:934–942  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

932 self.assertEqual(cur.fetchone(), (0,))
933
934 def test_escape_nested_sequence(self):
935 con = self.connect()
936 cur = con.cursor()
937 cur.execute("SET sql_mode='NO_BACKSLASH_ESCAPES'")
938 rows = (("foo'bar", "foo\\bar"), ("baz", "qux"))
939 cur.execute("SELECT (%s, %s) IN %s", ("foo'bar", "foo\\bar", rows))
940 self.assertEqual(cur.fetchone(), (1,))
941 cur.execute("SELECT (%s, %s) IN %s", ("foo'bar", "qux", rows))
942 self.assertEqual(cur.fetchone(), (0,))
943
944 def test_escape_builtin_encoders(self):
945 con = self.connect()

Callers

nothing calls this directly

Calls 4

cursorMethod · 0.80
executeMethod · 0.80
connectMethod · 0.45
fetchoneMethod · 0.45

Tested by

no test coverage detected