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

Method test_dupes_add

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

Source from the content-addressed store, hash-verified

906 assert "kcol2" in cc
907
908 def test_dupes_add(self):
909 c1, c2a, c3, c2b = (
910 column("c1"),
911 column("c2"),
912 column("c3"),
913 column("c2"),
914 )
915
916 cc = sql.ColumnCollection()
917
918 cc.add(c1)
919 cc.add(c2a, "c2")
920 cc.add(c3)
921 cc.add(c2b)
922
923 eq_(cc._all_columns, [c1, c2a, c3, c2b])
924
925 eq_(list(cc), [c1, c2a, c3, c2b])
926 eq_(cc.keys(), ["c1", "c2", "c3", "c2"])
927
928 assert cc.contains_column(c2a)
929 assert cc.contains_column(c2b)
930
931 # this is deterministic
932 is_(cc["c2"], c2a)
933
934 self._assert_collection_integrity(cc)
935
936 ci = cc.as_readonly()
937 eq_(ci._all_columns, [c1, c2a, c3, c2b])
938 eq_(list(ci), [c1, c2a, c3, c2b])
939 eq_(ci.keys(), ["c1", "c2", "c3", "c2"])
940
941 def test_dupes_construct(self):
942 c1, c2a, c3, c2b = (

Callers

nothing calls this directly

Calls 9

addMethod · 0.95
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