MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_processors

Method test_processors

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

Source from the content-addressed store, hash-verified

267 is_true(isinstance(row3, dump_cls))
268
269 def test_processors(self):
270 parent = result.SimpleResultMetaData(["a", "b", "c", "d"])
271 data = (1, 99, "42", "foo")
272 row_none = result.Row(parent, None, parent._key_to_index, data)
273 eq_(row_none._to_tuple_instance(), data)
274 row_all_p = result.Row(
275 parent, [str, float, int, str.upper], parent._key_to_index, data
276 )
277 eq_(row_all_p._to_tuple_instance(), ("1", 99.0, 42, "FOO"))
278 row_some_p = result.Row(
279 parent, [None, str, None, str.upper], parent._key_to_index, data
280 )
281 eq_(row_some_p._to_tuple_instance(), (1, "99", "42", "FOO"))
282 with expect_raises(AssertionError):
283 result.Row(parent, [None, str], parent._key_to_index, data)
284
285 def test_tuplegetter(self):
286 data = list(range(10, 20))

Callers

nothing calls this directly

Calls 3

eq_Function · 0.90
expect_raisesFunction · 0.90
_to_tuple_instanceMethod · 0.80

Tested by

no test coverage detected