File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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"
Original file line number Diff line number Diff line change @@ -120,7 +120,7 @@ def test_from_api_bad_block_uuid():
120120
121121def 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 )
You can’t perform that action at this time.
0 commit comments