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

Method test_escape_custom_object

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

Source from the content-addressed store, hash-verified

949 self.assertEqual(con.escape(val.timetuple()), "'2012-03-04 05:06:00'")
950
951 def test_escape_custom_object(self):
952 con = self.connect()
953
954 mapping = {Foo: escape_foo}
955 self.assertEqual(con.escape(Foo(), mapping), "bar")
956
957 def test_escape_fallback_encoder(self):
958 con = self.connect()

Callers

nothing calls this directly

Calls 3

FooClass · 0.85
escapeMethod · 0.80
connectMethod · 0.45

Tested by

no test coverage detected