| 118 | |
| 119 | |
| 120 | def test_basic_operations(repo_fixtures, request): |
| 121 | with get_repository_from_fixture(repo_fixtures, request) as repository: |
| 122 | for x in range(100): |
| 123 | repository.put(H(x), fchunk(b"SOMEDATA")) |
| 124 | key50 = H(50) |
| 125 | assert pdchunk(repository.get(key50)) == b"SOMEDATA" |
| 126 | repository.delete(key50) |
| 127 | with pytest.raises(LegacyRepository.ObjectNotFound): |
| 128 | repository.get(key50) |
| 129 | repository.commit(compact=False) |
| 130 | with reopen(repository) as repository: |
| 131 | with pytest.raises(LegacyRepository.ObjectNotFound): |
| 132 | repository.get(key50) |
| 133 | for x in range(100): |
| 134 | if x == 50: |
| 135 | continue |
| 136 | assert pdchunk(repository.get(H(x))) == b"SOMEDATA" |
| 137 | |
| 138 | |
| 139 | def test_multiple_transactions(repo_fixtures, request): |