improve code coverage by removing untested raise RuntimeError and replacing it with tested assert

This commit is contained in:
Zooko O'Whielacronx 2007-10-26 18:37:40 -07:00
parent 81e0820904
commit d7af8ae677

View File

@ -172,6 +172,8 @@ class Directory(rend.Page):
# build the base of the uri_link link url
uri_link = "/uri/" + urllib.quote(target.get_uri().replace("/", "!"))
assert IFileNode.providedBy(target) or IDirectoryNode.providedBy(target), target
if IFileNode.providedBy(target):
# file
@ -206,8 +208,6 @@ class Directory(rend.Page):
ctx.fillSlots("type", dirtype)
ctx.fillSlots("size", "-")
text_plain_tag = None
else:
raise RuntimeError("unknown thing %s" % (target,))
childdata = [T.a(href="%s?t=json" % name)["JSON"], ", ",
T.a(href="%s?t=uri" % name)["URI"], ", ",