Use successResultOf in renderSynchronously

Get rid of [].append trick when dealing with the deferred.
This commit is contained in:
Sajith Sasidharan 2020-02-13 17:00:54 -05:00
parent e2fc1fc07e
commit c061f6830e

View File

@ -2969,9 +2969,8 @@ def renderSynchronously(ss):
:param _StorageStatus ss: a StorageStatus instance.
"""
elem = StorageStatusElement(ss.storage, ss.nickname)
result = []
flattenString(None, elem).addCallback(result.append)
return result[0]
deferred = flattenString(None, elem)
return unittest.TestCase().successResultOf(deferred)
class MyBucketCountingCrawler(BucketCountingCrawler):
def finished_prefix(self, cycle, prefix):