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

Method test_serialize

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

Source from the content-addressed store, hash-verified

189 assert_raises(TypeError, should_raise)
190
191 def test_serialize(self):
192 keyed_tuple = self._fixture([1, 2, 3], ["a", None, "b"])
193
194 for loads, dumps in picklers():
195 kt = loads(dumps(keyed_tuple))
196
197 eq_(str(kt), "(1, 2, 3)")
198
199 eq_(list(kt._mapping.keys()), ["a", "b"])
200 eq_(kt._fields, ("a", "b"))
201 eq_(kt._asdict(), {"a": 1, "b": 3})
202
203 @testing.requires.cextensions
204 @testing.variation("direction", ["py_to_cy", "cy_to_py"])

Callers

nothing calls this directly

Calls 7

_fixtureMethod · 0.95
picklersFunction · 0.90
eq_Function · 0.90
loadsFunction · 0.85
dumpsFunction · 0.85
_asdictMethod · 0.80
keysMethod · 0.45

Tested by

no test coverage detected