mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-02-22 18:22:40 +00:00
Fix tests.
This commit is contained in:
parent
c92c93e6d5
commit
ba9946e6ea
@ -310,7 +310,7 @@ class StorageClient(object):
|
||||
_base_url: DecodedURL
|
||||
_swissnum: bytes
|
||||
_treq: Union[treq, StubTreq, HTTPClient]
|
||||
_pool: HTTPConnectionPool
|
||||
_pool: Optional[HTTPConnectionPool]
|
||||
_clock: IReactorTime
|
||||
|
||||
@classmethod
|
||||
@ -482,7 +482,8 @@ class StorageClient(object):
|
||||
|
||||
def shutdown(self) -> Deferred:
|
||||
"""Shutdown any connections."""
|
||||
return self._pool.closeCachedConnections()
|
||||
if self._pool is not None:
|
||||
return self._pool.closeCachedConnections()
|
||||
|
||||
|
||||
@define(hash=True)
|
||||
|
@ -331,6 +331,7 @@ class CustomHTTPServerTests(SyncTestCase):
|
||||
DecodedURL.from_text("http://127.0.0.1"),
|
||||
SWISSNUM_FOR_TEST,
|
||||
treq=treq,
|
||||
pool=None,
|
||||
# We're using a Treq private API to get the reactor, alas, but only
|
||||
# in a test, so not going to worry about it too much. This would be
|
||||
# fixed if https://github.com/twisted/treq/issues/226 were ever
|
||||
@ -512,6 +513,7 @@ class HttpTestFixture(Fixture):
|
||||
DecodedURL.from_text("http://127.0.0.1"),
|
||||
SWISSNUM_FOR_TEST,
|
||||
treq=self.treq,
|
||||
pool=None,
|
||||
clock=self.clock,
|
||||
)
|
||||
|
||||
@ -624,6 +626,7 @@ class GenericHTTPAPITests(SyncTestCase):
|
||||
DecodedURL.from_text("http://127.0.0.1"),
|
||||
b"something wrong",
|
||||
treq=StubTreq(self.http.http_server.get_resource()),
|
||||
pool=None,
|
||||
clock=self.http.clock,
|
||||
)
|
||||
)
|
||||
@ -1455,7 +1458,7 @@ class SharedImmutableMutableTestsMixin:
|
||||
self.client.advise_corrupt_share(storage_index, 13, reason)
|
||||
)
|
||||
|
||||
for (si, share_number) in [(storage_index, 11), (urandom(16), 13)]:
|
||||
for si, share_number in [(storage_index, 11), (urandom(16), 13)]:
|
||||
with assert_fails_with_http_code(self, http.NOT_FOUND):
|
||||
self.http.result_of_with_flush(
|
||||
self.client.advise_corrupt_share(si, share_number, reason)
|
||||
|
Loading…
x
Reference in New Issue
Block a user