MCPcopy
hub / github.com/psycopg/psycopg / test_dict

Method test_dict

tests/test_sql.py:106–112  ·  view source on GitHub ↗
(self, conn)

Source from the content-addressed store, hash-verified

104 assert s1 == 'select "field" from "table"'
105
106 def test_dict(self, conn):
107 s = sql.SQL("select {f} from {t}").format(
108 f=sql.Identifier("field"), t=sql.Identifier("table")
109 )
110 s1 = s.as_string(conn)
111 assert isinstance(s1, str)
112 assert s1 == 'select "field" from "table"'
113
114 def test_compose_literal(self, conn):
115 s = sql.SQL("select {0};").format(sql.Literal(dt.date(2016, 12, 31)))

Callers

nothing calls this directly

Calls 2

formatMethod · 0.80
as_stringMethod · 0.45

Tested by

no test coverage detected