MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_getitem

Method test_getitem

test/sql/test_operators.py:1034–1042  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1032 self.assert_compile(Column("x", MyType()).contains(5), "x -> :x_1")
1033
1034 def test_getitem(self):
1035 class MyType(UserDefinedType):
1036 cache_ok = True
1037
1038 class comparator_factory(UserDefinedType.Comparator):
1039 def __getitem__(self, index):
1040 return self.op("->")(index)
1041
1042 self.assert_compile(Column("x", MyType())[5], "x -> :x_1")
1043
1044 def test_op_not_an_iterator(self):
1045 # see [ticket:2726]

Callers

nothing calls this directly

Calls 3

ColumnClass · 0.90
assert_compileMethod · 0.80
MyTypeClass · 0.70

Tested by

no test coverage detected