MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_duplicate_labels

Method test_duplicate_labels

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

Source from the content-addressed store, hash-verified

162 eq_(keyed_tuple[2], 3)
163
164 def test_duplicate_labels(self):
165 keyed_tuple = self._fixture([1, 2, 3], ["a", "b", "b"])
166 eq_(str(keyed_tuple), "(1, 2, 3)")
167
168 eq_(list(keyed_tuple._mapping.keys()), ["a", "b", "b"])
169 eq_(keyed_tuple._fields, ("a", "b", "b"))
170 eq_(keyed_tuple._asdict(), {"a": 1, "b": 3})
171
172 # attribute access: can't get at value 2
173 eq_(keyed_tuple.a, 1)
174 eq_(keyed_tuple.b, 3)
175
176 # index access: can get at value 2
177 eq_(keyed_tuple[0], 1)
178 eq_(keyed_tuple[1], 2)
179 eq_(keyed_tuple[2], 3)
180
181 def test_immutable(self):
182 keyed_tuple = self._fixture([1, 2], ["a", "b"])

Callers

nothing calls this directly

Calls 4

_fixtureMethod · 0.95
eq_Function · 0.90
_asdictMethod · 0.80
keysMethod · 0.45

Tested by

no test coverage detected