| 81 | assert all((temp[val] == pos) for pos, val in enumerate(string.ascii_lowercase)) |
| 82 | |
| 83 | def test_eq(): |
| 84 | mapping = [(val, pos) for pos, val in enumerate(string.ascii_lowercase)] |
| 85 | temp1 = SortedDict(mapping) |
| 86 | temp2 = SortedDict(mapping) |
| 87 | assert temp1 == temp2 |
| 88 | assert not (temp1 != temp2) |
| 89 | temp2['a'] = 100 |
| 90 | assert temp1 != temp2 |
| 91 | assert not (temp1 == temp2) |
| 92 | del temp2['a'] |
| 93 | assert temp1 != temp2 |
| 94 | assert not (temp1 == temp2) |
| 95 | temp2['zz'] = 0 |
| 96 | assert temp1 != temp2 |
| 97 | assert not (temp1 == temp2) |
| 98 | |
| 99 | def test_iter(): |
| 100 | mapping = [(val, pos) for pos, val in enumerate(string.ascii_lowercase)] |