Another passing test.

This commit is contained in:
Itamar Turner-Trauring 2020-12-21 10:58:09 -05:00
parent d8197d9554
commit a2f042845d
2 changed files with 7 additions and 7 deletions

View File

@ -81,7 +81,7 @@ class Grid(GridTestMixin, WebErrorMixin, ShouldFailMixin, testutil.ReallyEqualMi
c0.create_mutable_file(publish.MutableData(DATA+b"3"))) c0.create_mutable_file(publish.MutableData(DATA+b"3")))
d.addCallback(_stash_mutable_uri, "corrupt") d.addCallback(_stash_mutable_uri, "corrupt")
d.addCallback(lambda ign: d.addCallback(lambda ign:
c0.upload(upload.Data("literal", convergence=b""))) c0.upload(upload.Data(b"literal", convergence=b"")))
d.addCallback(_stash_uri, "small") d.addCallback(_stash_uri, "small")
d.addCallback(lambda ign: c0.create_immutable_dirnode({})) d.addCallback(lambda ign: c0.create_immutable_dirnode({}))
d.addCallback(_stash_mutable_uri, "smalldir") d.addCallback(_stash_mutable_uri, "smalldir")
@ -618,7 +618,7 @@ class Grid(GridTestMixin, WebErrorMixin, ShouldFailMixin, testutil.ReallyEqualMi
d.addCallback(_stash_uri, "good") d.addCallback(_stash_uri, "good")
d.addCallback(lambda ign: d.addCallback(lambda ign:
self.rootnode.add_file(u"small", self.rootnode.add_file(u"small",
upload.Data("literal", upload.Data(b"literal",
convergence=b""))) convergence=b"")))
d.addCallback(_stash_uri, "small") d.addCallback(_stash_uri, "small")
d.addCallback(lambda ign: d.addCallback(lambda ign:
@ -791,7 +791,7 @@ class Grid(GridTestMixin, WebErrorMixin, ShouldFailMixin, testutil.ReallyEqualMi
d.addCallback(_stash_uri, "good") d.addCallback(_stash_uri, "good")
d.addCallback(lambda ign: d.addCallback(lambda ign:
self.rootnode.add_file(u"small", self.rootnode.add_file(u"small",
upload.Data("literal", upload.Data(b"literal",
convergence=b""))) convergence=b"")))
d.addCallback(_stash_uri, "small") d.addCallback(_stash_uri, "small")
d.addCallback(lambda ign: d.addCallback(lambda ign:

View File

@ -225,7 +225,7 @@ class DirectoryNodeHandler(ReplaceMeMixin, Resource, object):
if not self.node.is_mutable() and t in FIXED_OUTPUT_TYPES: if not self.node.is_mutable() and t in FIXED_OUTPUT_TYPES:
si = self.node.get_storage_index() si = self.node.get_storage_index()
if si and req.setETag('DIR:%s-%s' % (base32.b2a(si), t or "")): if si and req.setETag('DIR:%s-%s' % (base32.b2a(si), t or "")):
return "" return b""
if not t: if not t:
# render the directory as HTML # render the directory as HTML
@ -1363,7 +1363,7 @@ class ManifestStreamer(dirnode.DeepStats):
j = json.dumps(d, ensure_ascii=True) j = json.dumps(d, ensure_ascii=True)
assert "\n" not in j assert "\n" not in j
self.req.write(j+"\n") self.req.write(j.encode("utf-8")+b"\n")
def finish(self): def finish(self):
stats = dirnode.DeepStats.get_results(self) stats = dirnode.DeepStats.get_results(self)
@ -1372,8 +1372,8 @@ class ManifestStreamer(dirnode.DeepStats):
} }
j = json.dumps(d, ensure_ascii=True) j = json.dumps(d, ensure_ascii=True)
assert "\n" not in j assert "\n" not in j
self.req.write(j+"\n") self.req.write(j.encode("utf-8")+b"\n")
return "" return b""
@implementer(IPushProducer) @implementer(IPushProducer)
class DeepCheckStreamer(dirnode.DeepStats): class DeepCheckStreamer(dirnode.DeepStats):