MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_none_label

Method test_none_label

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

Source from the content-addressed store, hash-verified

145 is_true("b" in keyed_tuple)
146
147 def test_none_label(self):
148 keyed_tuple = self._fixture([1, 2, 3], ["a", None, "b"])
149 eq_(str(keyed_tuple), "(1, 2, 3)")
150
151 eq_(list(keyed_tuple._mapping.keys()), ["a", "b"])
152 eq_(keyed_tuple._fields, ("a", "b"))
153 eq_(keyed_tuple._asdict(), {"a": 1, "b": 3})
154
155 # attribute access: can't get at value 2
156 eq_(keyed_tuple.a, 1)
157 eq_(keyed_tuple.b, 3)
158
159 # index access: can get at value 2
160 eq_(keyed_tuple[0], 1)
161 eq_(keyed_tuple[1], 2)
162 eq_(keyed_tuple[2], 3)
163
164 def test_duplicate_labels(self):
165 keyed_tuple = self._fixture([1, 2, 3], ["a", "b", "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