MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_replace

Method test_replace

test/base/test_utils.py:1243–1270  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1241 eq_(list(ci), [c1, c2, c3])
1242
1243 def test_replace(self):
1244 cc = DedupeColumnCollection()
1245 ci = cc.as_readonly()
1246
1247 c1, c2a, c3, c2b = (
1248 column("c1"),
1249 column("c2"),
1250 column("c3"),
1251 column("c2"),
1252 )
1253
1254 cc.add(c1)
1255 cc.add(c2a)
1256 cc.add(c3)
1257
1258 cc.replace(c2b)
1259
1260 eq_(cc._all_columns, [c1, c2b, c3])
1261 eq_(list(cc), [c1, c2b, c3])
1262 is_(cc[1], c2b)
1263
1264 assert not cc.contains_column(c2a)
1265 assert cc.contains_column(c2b)
1266 self._assert_collection_integrity(cc)
1267
1268 eq_(ci._all_columns, [c1, c2b, c3])
1269 eq_(list(ci), [c1, c2b, c3])
1270 is_(ci[1], c2b)
1271
1272 def test_replace_key_matches_name_of_another(self):
1273 cc = DedupeColumnCollection()

Callers

nothing calls this directly

Calls 9

addMethod · 0.95
replaceMethod · 0.95
columnFunction · 0.90
eq_Function · 0.90
is_Function · 0.90
as_readonlyMethod · 0.45
contains_columnMethod · 0.45

Tested by

no test coverage detected