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

Method test_row_getitem_string

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

Source from the content-addressed store, hash-verified

695 eq_(row._mapping["col1"], 1)
696
697 def test_row_getitem_string(self, connection):
698 users = self.tables.users
699
700 connection.execute(
701 users.insert(),
702 [
703 dict(user_id=1, user_name="john"),
704 dict(user_id=2, user_name="jack"),
705 ],
706 )
707
708 r = connection.execute(
709 text("select * from users where user_id=2")
710 ).first()
711
712 with expect_raises_message(TypeError, "tuple indices must be"):
713 r["foo"]
714
715 eq_(r._mapping["user_name"], "jack")
716
717 def test_row_getitem_column(self, connection):
718 col = literal_column("1").label("foo")

Callers

nothing calls this directly

Calls 6

textFunction · 0.90
expect_raises_messageFunction · 0.90
eq_Function · 0.90
executeMethod · 0.45
insertMethod · 0.45
firstMethod · 0.45

Tested by

no test coverage detected