MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _assert_bind_args

Method _assert_bind_args

test/orm/test_query.py:7096–7109  ·  view source on GitHub ↗
(self, session, expect_mapped_bind=True)

Source from the content-addressed store, hash-verified

7094
7095 @contextlib.contextmanager
7096 def _assert_bind_args(self, session, expect_mapped_bind=True):
7097 get_bind = mock.Mock(side_effect=session.get_bind)
7098 with mock.patch.object(session, "get_bind", get_bind):
7099 yield
7100 for call_ in get_bind.mock_calls:
7101 if expect_mapped_bind:
7102 eq_(
7103 call_,
7104 mock.call(
7105 clause=mock.ANY, mapper=inspect(self.classes.User)
7106 ),
7107 )
7108 else:
7109 eq_(call_, mock.call(clause=mock.ANY))
7110
7111 def test_single_entity_q(self):
7112 User = self.classes.User

Calls 3

eq_Function · 0.90
inspectFunction · 0.90
objectMethod · 0.80

Tested by

no test coverage detected