MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / CoreFixtures

Class CoreFixtures

test/sql/test_compare.py:185–1303  ·  test/sql/test_compare.py::CoreFixtures

Source from the content-addressed store, hash-verified

183
184
185class CoreFixtures:
186 class="cm"># lambdas which return a tuple of ColumnElement objects.
187 class="cm"># must return at least two objects that should compare differently.
188 class="cm"># to test more varieties of class="st">"difference" additional objects can be added.
189 fixtures = [
190 lambda: (
191 column(class="st">"q"),
192 column(class="st">"x"),
193 column(class="st">"q", Integer),
194 column(class="st">"q", String),
195 ),
196 lambda: (~column(class="st">"q", Boolean), ~column(class="st">"p", Boolean)),
197 lambda: (
198 table_a.c.a.label(class="st">"foo"),
199 table_a.c.a.label(class="st">"bar"),
200 table_a.c.b.label(class="st">"foo"),
201 ),
202 lambda: (
203 _label_reference(table_a.c.a.desc()),
204 _label_reference(table_a.c.a.asc()),
205 ),
206 lambda: (
207 TypeClause(String(50)),
208 TypeClause(DateTime()),
209 ),
210 lambda: (
211 table_a.c.a,
212 ElementList([table_a.c.a]),
213 ElementList([table_a.c.a, table_a.c.b]),
214 ),
215 lambda: (
216 table_a.c.a,
217 OrderByList([table_a.c.a]),
218 OrderByList(
219 [table_a.c.a, OrderByList([table_a.c.b, table_b.c.a])]
220 ),
221 ),
222 lambda: (_textual_label_reference(class="st">"a"), _textual_label_reference(class="st">"b")),
223 lambda: (
224 text(class="st">"select a, b from table").columns(a=Integer, b=String),
225 text(class="st">"select a, b, c from table").columns(
226 a=Integer, b=String, c=Integer
227 ),
228 text(class="st">"select a, b, c from table where foo=:bar").bindparams(
229 bindparam(class="st">"bar", type_=Integer)
230 ),
231 text(class="st">"select a, b, c from table where foo=:foo").bindparams(
232 bindparam(class="st">"foo", type_=Integer)
233 ),
234 text(class="st">"select a, b, c from table where foo=:bar").bindparams(
235 bindparam(class="st">"bar", type_=String)
236 ),
237 ),
238 lambda: (
239 class="cm"># test #11471
240 text(class="st">"select * from table")
241 .columns(a=Integer())
242 .add_cte(table_b.select().cte()),

Callers

nothing calls this directly

Calls 15

columnFunction · 0.90
_label_referenceClass · 0.90
TypeClauseClass · 0.90
StringClass · 0.90
DateTimeClass · 0.90
ElementListClass · 0.90
OrderByListClass · 0.90
textFunction · 0.90
bindparamFunction · 0.90
IntegerClass · 0.90
unionFunction · 0.90

Tested by

no test coverage detected