From: Zooko O'Whielacronx Date: Sat, 27 Oct 2007 01:37:40 +0000 (-0700) Subject: improve code coverage by removing untested raise RuntimeError and replacing it with... X-Git-Url: https://git.rkrishnan.org/?a=commitdiff_plain;h=d7af8ae677789ee78b332b87e0aad3a5736f48ad;p=tahoe-lafs%2Ftahoe-lafs.git improve code coverage by removing untested raise RuntimeError and replacing it with tested assert --- diff --git a/src/allmydata/webish.py b/src/allmydata/webish.py index 9248a51d..3a07ab2a 100644 --- a/src/allmydata/webish.py +++ b/src/allmydata/webish.py @@ -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"], ", ",