Use a set, not a list, for share numbers.

This commit is contained in:
Itamar Turner-Trauring 2022-01-20 12:39:25 -05:00
parent 587a510b06
commit 2a2ab1ead7
2 changed files with 3 additions and 3 deletions

View File

@ -21,7 +21,7 @@ if PY2:
else:
# typing module not available in Python 2, and we only do type checking in
# Python 3 anyway.
from typing import Union, Set, List, Optional
from typing import Union, Set, Optional
from treq.testing import StubTreq
from base64 import b64encode
@ -148,7 +148,7 @@ class StorageClientImmutables(object):
upload_secret,
lease_renew_secret,
lease_cancel_secret,
): # type: (bytes, List[int], int, bytes, bytes, bytes) -> Deferred[ImmutableCreateResult]
): # type: (bytes, Set[int], int, bytes, bytes, bytes) -> Deferred[ImmutableCreateResult]
"""
Create a new storage index for an immutable.

View File

@ -303,7 +303,7 @@ class ImmutableHTTPAPITests(SyncTestCase):
lease_secret = urandom(32)
storage_index = b"".join(bytes([i]) for i in range(16))
created = yield im_client.create(
storage_index, [1], 100, upload_secret, lease_secret, lease_secret
storage_index, {1}, 100, upload_secret, lease_secret, lease_secret
)
self.assertEqual(
created, ImmutableCreateResult(already_have=set(), allocated={1})