()
| 155 | |
| 156 | |
| 157 | def test_protected(): |
| 158 | td = TabularData(["col1", "col2", "col3", "other"]) |
| 159 | td.append(["foo", "bar", "baz", "other_val"]) |
| 160 | td.protect("col1", "col2") |
| 161 | |
| 162 | td.drop("col1", "col2", "col3", "other") |
| 163 | assert td.keys() == ["col1", "col2"] |
| 164 | assert list(td) == [["foo", "bar"]] |
| 165 | |
| 166 | td.unprotect("col2") |
| 167 | |
| 168 | td.drop("col1", "col2") |
| 169 | assert td.keys() == ["col1"] |
| 170 | assert list(td) == [["foo"]] |
| 171 | |
| 172 | |
| 173 | def test_row_from_dict(): |