From ce29843c09310de0e8db597bb558ccd3bd4bbbfd Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone <exarkun@twistedmatrix.com> Date: Thu, 11 Nov 2021 16:23:10 -0500 Subject: [PATCH] docstring and light reformatting --- src/_zkapauthorizer/tests/test_storage_protocol.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/_zkapauthorizer/tests/test_storage_protocol.py b/src/_zkapauthorizer/tests/test_storage_protocol.py index 8d9b89e..74b3cad 100644 --- a/src/_zkapauthorizer/tests/test_storage_protocol.py +++ b/src/_zkapauthorizer/tests/test_storage_protocol.py @@ -450,8 +450,18 @@ class ShareTests(TestCase): ) def get_lease_grant_times(storage_server, storage_index): - for sharenum, sharepath in storage_server._get_bucket_shares(storage_index): - yield sharenum, list(lease.get_grant_renew_time_time() for lease in get_share_file(sharepath).get_leases()) + """ + 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 -- GitLab