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

Method test_dupes_construct

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

Source from the content-addressed store, hash-verified

939 eq_(ci.keys(), ["c1", "c2", "c3", "c2"])
940
941 def test_dupes_construct(self):
942 c1, c2a, c3, c2b = (
943 column("c1"),
944 column("c2"),
945 column("c3"),
946 column("c2"),
947 )
948
949 cc = sql.ColumnCollection(
950 columns=[("c1", c1), ("c2", c2a), ("c3", c3), ("c2", c2b)]
951 )
952
953 eq_(cc._all_columns, [c1, c2a, c3, c2b])
954
955 eq_(list(cc), [c1, c2a, c3, c2b])
956 eq_(cc.keys(), ["c1", "c2", "c3", "c2"])
957
958 assert cc.contains_column(c2a)
959 assert cc.contains_column(c2b)
960
961 # this is deterministic
962 is_(cc["c2"], c2a)
963
964 self._assert_collection_integrity(cc)
965
966 ci = cc.as_readonly()
967 eq_(ci._all_columns, [c1, c2a, c3, c2b])
968 eq_(list(ci), [c1, c2a, c3, c2b])
969 eq_(ci.keys(), ["c1", "c2", "c3", "c2"])
970
971 def test_identical_dupe_construct(self):
972 c1, c2, c3 = (column("c1"), column("c2"), column("c3"))

Callers

nothing calls this directly

Calls 8

keysMethod · 0.95
contains_columnMethod · 0.95
as_readonlyMethod · 0.95
columnFunction · 0.90
eq_Function · 0.90
is_Function · 0.90
keysMethod · 0.45

Tested by

no test coverage detected