MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_row_mapping_keys

Method test_row_mapping_keys

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

Source from the content-addressed store, hash-verified

1612 eq_(obj._fields, ("user_id", "user_name"))
1613
1614 def test_row_mapping_keys(self, connection):
1615 users = self.tables.users
1616
1617 connection.execute(users.insert(), dict(user_id=1, user_name="foo"))
1618 result = connection.execute(users.select())
1619 eq_(result.keys(), ["user_id", "user_name"])
1620 row = result.first()
1621 eq_(list(row._mapping.keys()), ["user_id", "user_name"])
1622 eq_(row._fields, ("user_id", "user_name"))
1623
1624 in_("user_id", row._fields)
1625 not_in("foo", row._fields)
1626 in_(users.c.user_id, row._mapping.keys())
1627
1628 def test_row_keys_legacy_dont_warn(self, connection):
1629 users = self.tables.users

Callers

nothing calls this directly

Calls 8

eq_Function · 0.90
in_Function · 0.90
not_inFunction · 0.90
executeMethod · 0.45
insertMethod · 0.45
selectMethod · 0.45
keysMethod · 0.45
firstMethod · 0.45

Tested by

no test coverage detected