mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-04-10 04:09:58 +00:00
correct use of succeeded, remove trailing spaces and unused import
Signed-off-by: fenn-cs <fenn25.fn@gmail.com>
This commit is contained in:
parent
90e84730e5
commit
7ad3fa9e25
@ -15,7 +15,6 @@ from os.path import join
|
||||
|
||||
from bs4 import BeautifulSoup
|
||||
|
||||
from twisted.trial import unittest
|
||||
from twisted.internet import reactor
|
||||
from twisted.internet import defer
|
||||
from testtools.twistedsupport import succeeded
|
||||
@ -60,7 +59,8 @@ from ..common_web import (
|
||||
)
|
||||
|
||||
from testtools.matchers import (
|
||||
Equals
|
||||
Equals,
|
||||
AfterPreprocessing,
|
||||
)
|
||||
|
||||
|
||||
@ -112,7 +112,6 @@ class IntroducerWeb(AsyncTestCase):
|
||||
# we have to arrange to have cleaned up.
|
||||
self.addCleanup(lambda: flushEventualQueue(None))
|
||||
return super(IntroducerWeb, self).setUp()
|
||||
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def test_welcome(self):
|
||||
@ -233,12 +232,10 @@ class IntroducerRootTests(SyncTestCase):
|
||||
0,
|
||||
)
|
||||
|
||||
resource = IntroducerRoot(introducer_node)
|
||||
response = json.loads(succeeded(
|
||||
render(resource, {b"t": [b"json"]}),
|
||||
)._matcher.result)
|
||||
deferred = defer.succeed({
|
||||
u"subscription_summary": {"arbitrary": 2},
|
||||
u"announcement_summary": {"arbitrary": 1},
|
||||
})
|
||||
self.assertThat(deferred.result, Equals(response))
|
||||
resource = IntroducerRoot(introducer_node)
|
||||
response = render(resource, {b"t": [b"json"]})
|
||||
expected = {
|
||||
u"subscription_summary": {"arbitrary": 2},
|
||||
u"announcement_summary": {"arbitrary": 1},
|
||||
}
|
||||
self.assertThat(response, succeeded(AfterPreprocessing(json.loads, Equals(expected)))
|
||||
|
Loading…
x
Reference in New Issue
Block a user