mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-20 13:33:09 +00:00
more-testtools-y asserts
This commit is contained in:
parent
57eb875354
commit
f0ac5a2cef
@ -41,7 +41,9 @@ from testtools import (
|
||||
from testtools.matchers import (
|
||||
Always,
|
||||
Equals,
|
||||
IsInstance,
|
||||
MatchesStructure,
|
||||
AfterPreprocessing,
|
||||
)
|
||||
from testtools.twistedsupport import (
|
||||
succeeded,
|
||||
@ -75,7 +77,7 @@ class FakeWebTest(TestCase):
|
||||
|
||||
cap_raw = yield resp.content()
|
||||
cap = from_string(cap_raw)
|
||||
self.assertIsInstance(cap, CHKFileURI)
|
||||
self.assertThat(cap, IsInstance(CHKFileURI))
|
||||
|
||||
resp = yield http_client.get(
|
||||
"http://example.com/uri?uri={}".format(cap.to_string())
|
||||
@ -114,8 +116,13 @@ class FakeWebTest(TestCase):
|
||||
self.assertEqual(resp.code, 201)
|
||||
|
||||
cap_raw = yield resp.content()
|
||||
cap = from_string(cap_raw)
|
||||
self.assertIsInstance(cap, CHKFileURI)
|
||||
self.assertThat(
|
||||
cap_raw,
|
||||
AfterPreprocessing(
|
||||
from_string,
|
||||
IsInstance(CHKFileURI)
|
||||
)
|
||||
)
|
||||
|
||||
resp = yield http_client.put("http://example.com/uri", content)
|
||||
self.assertThat(resp.code, Equals(200))
|
||||
|
Loading…
Reference in New Issue
Block a user