File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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" )
You can’t perform that action at this time.
0 commit comments