(self)
| 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")) |
nothing calls this directly
no test coverage detected