mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-06-11 20:11:47 +00:00
Correct the assertion about how "not found" should be handled
Behavior verified visually against a live client node: ``` ❯ curl -v 'http://localhost:3456/uri/URI:CHK:cmtcxq7hwxvfxan34yiev6ivhy:qvcekmjtoetdcw4kmi7b3rtblvgx7544crnwaqtiewemdliqsokq:1:1:1' * Trying 127.0.0.1:3456... * Connected to localhost (127.0.0.1) port 3456 (#0) > GET /uri/URI:CHK:cmtcxq7hwxvfxan34yiev6ivhy:qvcekmjtoetdcw4kmi7b3rtblvgx7544crnwaqtiewemdliqsokq:1:1:1 HTTP/1.1 > Host: localhost:3456 > User-Agent: curl/7.83.1 > Accept: */* > * Mark bundle as not supporting multiuse < HTTP/1.1 410 Gone < X-Frame-Options: DENY < Referrer-Policy: no-referrer < Server: TwistedWeb/22.10.0 < Date: Tue, 29 Nov 2022 15:39:47 GMT < Content-Type: text/plain;charset=utf-8 < Accept-Ranges: bytes < Content-Length: 294 < ETag: ui2tnwl5lltj5clzpyff42jdce- < NoSharesError: no shares could be found. Zero shares usually indicates a corrupt URI, or that no servers were connected, but it might also indicate severe corruption. You should perform a filecheck on this object to learn more. The full error message is: * Connection #0 to host localhost left intact no shares (need 1). Last failure: None ```
This commit is contained in:
@ -9,18 +9,7 @@
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
Tests for the allmydata.testing helpers
|
Tests for the allmydata.testing helpers
|
||||||
|
|
||||||
Ported to Python 3.
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
from __future__ import absolute_import
|
|
||||||
from __future__ import division
|
|
||||||
from __future__ import print_function
|
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from future.utils import PY2
|
|
||||||
if PY2:
|
|
||||||
from future.builtins import filter, map, zip, ascii, chr, hex, input, next, oct, open, pow, round, super, bytes, dict, list, object, range, str, max, min # noqa: F401
|
|
||||||
|
|
||||||
from twisted.internet.defer import (
|
from twisted.internet.defer import (
|
||||||
inlineCallbacks,
|
inlineCallbacks,
|
||||||
@ -56,10 +45,12 @@ from testtools.matchers import (
|
|||||||
IsInstance,
|
IsInstance,
|
||||||
MatchesStructure,
|
MatchesStructure,
|
||||||
AfterPreprocessing,
|
AfterPreprocessing,
|
||||||
|
Contains,
|
||||||
)
|
)
|
||||||
from testtools.twistedsupport import (
|
from testtools.twistedsupport import (
|
||||||
succeeded,
|
succeeded,
|
||||||
)
|
)
|
||||||
|
from twisted.web.http import GONE
|
||||||
|
|
||||||
|
|
||||||
class FakeWebTest(SyncTestCase):
|
class FakeWebTest(SyncTestCase):
|
||||||
@ -144,7 +135,8 @@ class FakeWebTest(SyncTestCase):
|
|||||||
|
|
||||||
def test_download_missing(self):
|
def test_download_missing(self):
|
||||||
"""
|
"""
|
||||||
Error if we download a capability that doesn't exist
|
The response to a request to download a capability that doesn't exist
|
||||||
|
is 410 (GONE).
|
||||||
"""
|
"""
|
||||||
|
|
||||||
http_client = create_tahoe_treq_client()
|
http_client = create_tahoe_treq_client()
|
||||||
@ -157,7 +149,11 @@ class FakeWebTest(SyncTestCase):
|
|||||||
resp,
|
resp,
|
||||||
succeeded(
|
succeeded(
|
||||||
MatchesStructure(
|
MatchesStructure(
|
||||||
code=Equals(500)
|
code=Equals(GONE),
|
||||||
|
content=AfterPreprocessing(
|
||||||
|
lambda m: m(),
|
||||||
|
succeeded(Contains(b"No data for")),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user