| 172 | |
| 173 | |
| 174 | def test_deletion(): |
| 175 | a = MemoryStorage(fileext='.a') |
| 176 | b = MemoryStorage(fileext='.b') |
| 177 | status = {} |
| 178 | |
| 179 | item = Item('UID:1') |
| 180 | a.upload(item) |
| 181 | item2 = Item('UID:2') |
| 182 | a.upload(item2) |
| 183 | sync(a, b, status) |
| 184 | b.delete('1.b', b.get('1.b')[1]) |
| 185 | sync(a, b, status) |
| 186 | assert items(a) == items(b) == {item2.raw} |
| 187 | |
| 188 | a.upload(item) |
| 189 | sync(a, b, status) |
| 190 | assert items(a) == items(b) == {item.raw, item2.raw} |
| 191 | a.delete('1.a', a.get('1.a')[1]) |
| 192 | sync(a, b, status) |
| 193 | assert items(a) == items(b) == {item2.raw} |
| 194 | |
| 195 | |
| 196 | def test_insert_hash(): |