use real parser
This commit is contained in:
parent
683c8d3e4f
commit
9d5e438c2d
|
@ -15,6 +15,10 @@ from twisted.internet.defer import (
|
|||
inlineCallbacks,
|
||||
)
|
||||
|
||||
from allmydata.uri import (
|
||||
from_string,
|
||||
CHKFileURI,
|
||||
)
|
||||
from allmydata.testing.web import (
|
||||
create_tahoe_treq_client,
|
||||
)
|
||||
|
@ -60,11 +64,12 @@ class FakeWebTest(TestCase):
|
|||
resp = yield self.http_client.put("http://example.com/uri", content)
|
||||
self.assertEqual(resp.code, 201)
|
||||
|
||||
cap = yield resp.content()
|
||||
self.assertTrue(cap.startswith("URI:CHK:"))
|
||||
cap_raw = yield resp.content()
|
||||
cap = from_string(cap_raw)
|
||||
self.assertIsInstance(cap, CHKFileURI)
|
||||
|
||||
resp = yield self.http_client.get(
|
||||
"http://example.com/uri?uri={}".format(cap)
|
||||
"http://example.com/uri?uri={}".format(cap.to_string())
|
||||
)
|
||||
self.assertEqual(resp.code, 200)
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@ def capability_generator(kind):
|
|||
key = base32.b2a(key_hasher.digest()[:16]) # key is 16 bytes
|
||||
ueb_hash = base32.b2a(ueb_hasher.digest()) # ueb hash is 32 bytes
|
||||
|
||||
cap = u"{kind}:{key}:{ueb_hash}:{n}:{k}:{size}".format(
|
||||
cap = u"{kind}{key}:{ueb_hash}:{n}:{k}:{size}".format(
|
||||
kind=kind,
|
||||
key=key,
|
||||
ueb_hash=ueb_hash,
|
||||
|
|
Loading…
Reference in New Issue