MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_get_embedded_bindparams

Method test_get_embedded_bindparams

test/sql/test_utils.py:50–69  ·  view source on GitHub ↗
(self, has_cache_key)

Source from the content-addressed store, hash-verified

48
49 @testing.variation("has_cache_key", [True, False])
50 def test_get_embedded_bindparams(self, has_cache_key):
51 bp = bindparam("x")
52
53 if not has_cache_key:
54
55 class NotCacheable(TypeDecorator):
56 impl = String
57 cache_ok = False
58
59 stmt = select(column("q", NotCacheable())).where(column("y") == bp)
60
61 else:
62 stmt = select(column("q")).where(column("y") == bp)
63
64 eq_(stmt._get_embedded_bindparams(), [bp])
65
66 if not has_cache_key:
67 is_(stmt._generate_cache_key(), None)
68 else:
69 is_not_none(stmt._generate_cache_key())
70
71 def test_find_tables_aliases(self):
72 metadata = MetaData()

Callers

nothing calls this directly

Calls 10

bindparamFunction · 0.90
selectFunction · 0.90
columnFunction · 0.90
eq_Function · 0.90
is_Function · 0.90
is_not_noneFunction · 0.90
NotCacheableClass · 0.85
whereMethod · 0.45
_generate_cache_keyMethod · 0.45

Tested by

no test coverage detected