]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
improve code coverage by removing untested raise RuntimeError and replacing it with...
authorZooko O'Whielacronx <zooko@zooko.com>
Sat, 27 Oct 2007 01:37:40 +0000 (18:37 -0700)
committerZooko O'Whielacronx <zooko@zooko.com>
Sat, 27 Oct 2007 01:37:40 +0000 (18:37 -0700)
src/allmydata/webish.py

index 9248a51dde91cae39c64ce1cb3a7846afbaeeb94..3a07ab2a642925d252c7ca381570c83f5b942df1 100644 (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"], ", ",