diff --git a/src/_zkapauthorizer/tests/test_storage_protocol.py b/src/_zkapauthorizer/tests/test_storage_protocol.py index 32e7e406380eaff0ce140f22b37db0cf394ae0a3..c027dfd42d06b4f4d8fa77581576382a7fc7bea7 100644 --- a/src/_zkapauthorizer/tests/test_storage_protocol.py +++ b/src/_zkapauthorizer/tests/test_storage_protocol.py @@ -449,20 +449,6 @@ class ShareTests(TestCase): ), ) - def get_lease_grant_times(storage_server, storage_index): - """ - Get the grant times for all of the leases for all of the shares at the - given storage index. - """ - shares = storage_server._get_bucket_shares(storage_index) - for sharenum, sharepath in shares: - sharefile = get_share_file(sharepath) - leases = sharefile.get_leases() - grant_times = list( - lease.get_grant_renew_time_time() for lease in leases - ) - yield sharenum, grant_times - expected_leases = {} # Chop off the non-integer part of the expected values because share # files only keep integer precision. @@ -1161,3 +1147,17 @@ def write_vector_to_read_vector(write_vector): write vector. """ return (write_vector[0], len(write_vector[1])) + +def get_lease_grant_times(storage_server, storage_index): + """ + Get the grant times for all of the leases for all of the shares at the + given storage index. + """ + shares = storage_server._get_bucket_shares(storage_index) + for sharenum, sharepath in shares: + sharefile = get_share_file(sharepath) + leases = sharefile.get_leases() + grant_times = list( + lease.get_grant_renew_time_time() for lease in leases + ) + yield sharenum, grant_times