Skip to content

Commit cab0cf3

Browse files
committed
Refactor progress
1 parent 6fc73b4 commit cab0cf3

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

common/tests/test_allocation.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,13 +203,17 @@ def test_from_enc_str_bad_fragment():
203203
Attempt to create an Allocation from a bad APIAllocation: one of the fragments has an invalid
204204
block UUID.
205205
"""
206+
# pylint: disable=protected-access
206207
pool, blocks = create_test_pool_and_blocks([10])
207208
# Bad block UUID
208209
with pytest.raises(InvalidBlockUUIDError):
209-
_allocation = Allocation.from_enc_str(f"not-a-uuid:0:5", pool)
210+
_allocation = Allocation.from_enc_str("not-a-uuid:0:5", pool)
210211
# Bad start index
211212
with pytest.raises(InvalidPSRDIndex):
212213
_allocation = Allocation.from_enc_str(f"{blocks[0].uuid}:20:5", pool)
213214
# Bad size
214215
with pytest.raises(InvalidPSRDIndex):
215216
_allocation = Allocation.from_enc_str(f"{blocks[0].uuid}:3:99999", pool)
217+
# No data taken from pool
218+
assert pool.nr_used_bytes == 0
219+
assert blocks[0]._data == bytes.fromhex("00010203040506070809")

0 commit comments

Comments
 (0)