(self)
| 1034 | eq_(ci.keys(), ["c1", "c2", "c3", "c2"]) |
| 1035 | |
| 1036 | def test_dupes_construct(self): |
| 1037 | c1, c2a, c3, c2b = ( |
| 1038 | column("c1"), |
| 1039 | column("c2"), |
| 1040 | column("c3"), |
| 1041 | column("c2"), |
| 1042 | ) |
| 1043 | |
| 1044 | cc = sql.WriteableColumnCollection( |
| 1045 | columns=[("c1", c1), ("c2", c2a), ("c3", c3), ("c2", c2b)] |
| 1046 | ) |
| 1047 | |
| 1048 | eq_(cc._all_columns, [c1, c2a, c3, c2b]) |
| 1049 | |
| 1050 | eq_(list(cc), [c1, c2a, c3, c2b]) |
| 1051 | eq_(cc.keys(), ["c1", "c2", "c3", "c2"]) |
| 1052 | |
| 1053 | assert cc.contains_column(c2a) |
| 1054 | assert cc.contains_column(c2b) |
| 1055 | |
| 1056 | # this is deterministic |
| 1057 | is_(cc["c2"], c2a) |
| 1058 | |
| 1059 | self._assert_collection_integrity(cc) |
| 1060 | |
| 1061 | ci = cc.as_readonly() |
| 1062 | eq_(ci._all_columns, [c1, c2a, c3, c2b]) |
| 1063 | eq_(list(ci), [c1, c2a, c3, c2b]) |
| 1064 | eq_(ci.keys(), ["c1", "c2", "c3", "c2"]) |
| 1065 | |
| 1066 | def test_identical_dupe_construct(self): |
| 1067 | c1, c2, c3 = (column("c1"), column("c2"), column("c3")) |
nothing calls this directly
no test coverage detected