MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_tuple_getter

Method test_tuple_getter

test/base/test_result.py:95–107  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

93 eq_(getter(keyed_tuple), 3)
94
95 def test_tuple_getter(self):
96 keyed_tuple = self._fixture([1, 2, 3], ["a", "b", "c"])
97
98 getter = keyed_tuple._parent._row_as_tuple_getter(["b", "c"])
99 eq_(getter(keyed_tuple), (2, 3))
100
101 # row as tuple getter doesn't accept ints. for ints, just
102 # use plain python
103
104 getter = operator.itemgetter(2, 0, 1)
105
106 # getter = keyed_tuple._parent._row_as_tuple_getter([2, 0, 1])
107 eq_(getter(keyed_tuple), (3, 1, 2))
108
109 def test_attribute_access(self):
110 keyed_tuple = self._fixture([1, 2], ["a", "b"])

Callers

nothing calls this directly

Calls 3

_fixtureMethod · 0.95
eq_Function · 0.90
_row_as_tuple_getterMethod · 0.80

Tested by

no test coverage detected