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

Method test_escape_fallback_encoder

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

Source from the content-addressed store, hash-verified

955 self.assertEqual(con.escape(Foo(), mapping), "bar")
956
957 def test_escape_fallback_encoder(self):
958 con = self.connect()
959
960 class Custom(str):
961 pass
962
963 mapping = {str: pymysql.converters.escape_string}
964 self.assertEqual(con.escape(Custom("foobar"), mapping), "'foobar'")
965
966 def test_escape_no_default(self):
967 con = self.connect()

Callers

nothing calls this directly

Calls 3

CustomClass · 0.85
escapeMethod · 0.80
connectMethod · 0.45

Tested by

no test coverage detected