From 26d31abd3583b66f56560cae8dfa57164e7ad4e5 Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone <exarkun@twistedmatrix.com> Date: Tue, 27 Jul 2021 11:52:25 -0400 Subject: [PATCH] Rename the slot-related strategies to avoid colliding with the test naming convention --- src/_zkapauthorizer/tests/strategies.py | 14 +++++++------- src/_zkapauthorizer/tests/test_storage_protocol.py | 12 ++++++------ src/_zkapauthorizer/tests/test_storage_server.py | 6 +++--- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/_zkapauthorizer/tests/strategies.py b/src/_zkapauthorizer/tests/strategies.py index c9f46fd..2ba763a 100644 --- a/src/_zkapauthorizer/tests/strategies.py +++ b/src/_zkapauthorizer/tests/strategies.py @@ -698,7 +698,7 @@ def shares(): ) -def data_vectors(): +def slot_data_vectors(): """ Build Tahoe-LAFS data vectors. """ @@ -717,7 +717,7 @@ def data_vectors(): ) -def test_vectors(): +def slot_test_vectors(): """ Build Tahoe-LAFS test vectors. """ @@ -748,14 +748,14 @@ class TestAndWriteVectors(object): return (self.test_vector, self.write_vector, self.new_length) -def test_and_write_vectors(): +def slot_test_and_write_vectors(): """ Build Tahoe-LAFS test and write vectors for a single share. """ return builds( TestAndWriteVectors, - test_vectors(), - data_vectors(), + slot_test_vectors(), + slot_data_vectors(), one_of( just(None), sizes(), @@ -763,13 +763,13 @@ def test_and_write_vectors(): ) -def test_and_write_vectors_for_shares(): +def slot_test_and_write_vectors_for_shares(): """ Build Tahoe-LAFS test and write vectors for a number of shares. """ return dictionaries( sharenums(), - test_and_write_vectors(), + slot_test_and_write_vectors(), # An empty dictionary wouldn't make much sense. And it provokes a # NameError from Tahoe, storage/server.py:479, `new_length` referenced # before assignment. diff --git a/src/_zkapauthorizer/tests/test_storage_protocol.py b/src/_zkapauthorizer/tests/test_storage_protocol.py index bd1cfe9..d79b0fc 100644 --- a/src/_zkapauthorizer/tests/test_storage_protocol.py +++ b/src/_zkapauthorizer/tests/test_storage_protocol.py @@ -89,7 +89,7 @@ from .strategies import ( sharenums, sharenum_sets, sizes, - test_and_write_vectors_for_shares, + slot_test_and_write_vectors_for_shares, clocks, # Not really a strategy... bytes_for_share, @@ -783,7 +783,7 @@ class ShareTests(TestCase): lease_renew_secrets(), lease_cancel_secrets(), ), - test_and_write_vectors_for_shares=test_and_write_vectors_for_shares(), + test_and_write_vectors_for_shares=slot_test_and_write_vectors_for_shares(), clock=clocks(), ) def test_stat_shares_mutable(self, storage_index, secrets, test_and_write_vectors_for_shares, clock): @@ -889,7 +889,7 @@ class ShareTests(TestCase): lease_renew_secrets(), lease_cancel_secrets(), ), - test_and_write_vectors_for_shares=test_and_write_vectors_for_shares(), + test_and_write_vectors_for_shares=slot_test_and_write_vectors_for_shares(), ) def test_create_mutable(self, storage_index, secrets, test_and_write_vectors_for_shares): """ @@ -938,7 +938,7 @@ class ShareTests(TestCase): lease_renew_secrets(), lease_cancel_secrets(), ), - test_and_write_vectors_for_shares=test_and_write_vectors_for_shares(), + test_and_write_vectors_for_shares=slot_test_and_write_vectors_for_shares(), ) def test_mutable_rewrite_preserves_lease(self, storage_index, secrets, test_and_write_vectors_for_shares): """ @@ -1000,7 +1000,7 @@ class ShareTests(TestCase): write_enabler=write_enabler_secrets(), renew_secret=lease_renew_secrets(), cancel_secret=lease_cancel_secrets(), - test_and_write_vectors_for_shares=test_and_write_vectors_for_shares(), + test_and_write_vectors_for_shares=slot_test_and_write_vectors_for_shares(), ) def test_mutable_rewrite_renews_expired_lease( self, @@ -1080,7 +1080,7 @@ class ShareTests(TestCase): lease_renew_secrets(), lease_cancel_secrets(), ), - test_and_write_vectors_for_shares=test_and_write_vectors_for_shares(), + test_and_write_vectors_for_shares=slot_test_and_write_vectors_for_shares(), ) def test_client_cannot_control_lease_behavior(self, storage_index, secrets, test_and_write_vectors_for_shares): """ diff --git a/src/_zkapauthorizer/tests/test_storage_server.py b/src/_zkapauthorizer/tests/test_storage_server.py index 314a0cf..a3d1451 100644 --- a/src/_zkapauthorizer/tests/test_storage_server.py +++ b/src/_zkapauthorizer/tests/test_storage_server.py @@ -80,7 +80,7 @@ from .strategies import ( write_enabler_secrets, lease_renew_secrets, lease_cancel_secrets, - test_and_write_vectors_for_shares, + slot_test_and_write_vectors_for_shares, ) from .fixtures import ( AnonymousStorageServer, @@ -414,7 +414,7 @@ class PassValidationTests(TestCase): lease_renew_secrets(), lease_cancel_secrets(), ), - test_and_write_vectors_for_shares=test_and_write_vectors_for_shares(), + test_and_write_vectors_for_shares=slot_test_and_write_vectors_for_shares(), ) def test_extend_mutable_with_write_fails_without_passes(self, storage_index, secrets, test_and_write_vectors_for_shares): """ @@ -581,7 +581,7 @@ class PassValidationTests(TestCase): lease_cancel_secrets(), ), sharenums=one_of(just(None), sharenum_sets()), - test_and_write_vectors_for_shares=test_and_write_vectors_for_shares(), + test_and_write_vectors_for_shares=slot_test_and_write_vectors_for_shares(), ) def test_mutable_share_sizes(self, slot, secrets, sharenums, test_and_write_vectors_for_shares): """ -- GitLab