MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / test_getitem

Method test_getitem

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

Source from the content-addressed store, hash-verified

951 self.assert_compile(Column("x", MyType()).contains(5), "x -> :x_1")
952
953 def test_getitem(self):
954 class MyType(UserDefinedType):
955 cache_ok = True
956
957 class comparator_factory(UserDefinedType.Comparator):
958 def __getitem__(self, index):
959 return self.op("->")(index)
960
961 self.assert_compile(Column("x", MyType())[5], "x -> :x_1")
962
963 def test_op_not_an_iterator(self):
964 # 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