MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_ro_mapping_py3k

Method test_ro_mapping_py3k

test/sql/test_resultset.py:1559–1576  ·  view source on GitHub ↗
(self, connection)

Source from the content-addressed store, hash-verified

1557 eq_(row._mapping[s.c.user_name], "ed")
1558
1559 def test_ro_mapping_py3k(self, connection):
1560 users = self.tables.users
1561
1562 connection.execute(users.insert(), dict(user_id=1, user_name="foo"))
1563 result = connection.execute(users.select())
1564
1565 row = result.first()
1566 dict_row = row._asdict()
1567
1568 odict_row = dict([("user_id", 1), ("user_name", "foo")])
1569 eq_(dict_row, odict_row)
1570
1571 mapping_row = row._mapping
1572
1573 eq_(list(mapping_row), list(mapping_row.keys()))
1574 eq_(odict_row.keys(), mapping_row.keys())
1575 eq_(odict_row.values(), mapping_row.values())
1576 eq_(odict_row.items(), mapping_row.items())
1577
1578 @testing.combinations(
1579 (lambda result: result),

Callers

nothing calls this directly

Calls 9

eq_Function · 0.90
_asdictMethod · 0.80
executeMethod · 0.45
insertMethod · 0.45
selectMethod · 0.45
firstMethod · 0.45
keysMethod · 0.45
valuesMethod · 0.45
itemsMethod · 0.45

Tested by

no test coverage detected