Skip to content

Commit fb89bcf

Browse files
committed
Refactor progress
1 parent 422d2d3 commit fb89bcf

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

common/tests/test_allocation.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,13 @@ def test_from_api_second_fragment_is_bad():
127127
_allocation = Allocation.from_api(_api_allocation, pool)
128128
assert pool.nr_used_bytes == 0
129129
assert blocks[0]._data == bytes.fromhex("00010203040506070809")
130+
131+
132+
def test_to_enc_str():
133+
"""
134+
Create an encoded string from an Allocation.
135+
"""
136+
pool, blocks = create_test_pool_and_blocks([5, 10])
137+
allocation = pool.allocate(8, purpose="test")
138+
enc_str = allocation.to_enc_str()
139+
assert enc_str == f"{blocks[0].uuid}:0:5,{blocks[1].uuid}:0:3"

common/tests/test_fragment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def test_from_api_bad_block_uuid():
120120

121121
def test_to_enc_str():
122122
"""
123-
Create an APIFragment for an encoded string.
123+
Create an encoded string from a Fragment.
124124
"""
125125
block = create_test_block(10)
126126
fragment = block.allocate_fragment(5)

0 commit comments

Comments
 (0)