From d7af8ae677789ee78b332b87e0aad3a5736f48ad Mon Sep 17 00:00:00 2001 From: Zooko O'Whielacronx Date: Fri, 26 Oct 2007 18:37:40 -0700 Subject: [PATCH] improve code coverage by removing untested raise RuntimeError and replacing it with tested assert --- src/allmydata/webish.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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"], ", ", -- 2.45.2