web/directory.py: slight shuffle to improve test coverage

This commit is contained in:
Brian Warner 2008-10-28 21:54:06 -07:00
parent 248033d78c
commit e1d9169ba3

View File

@ -36,10 +36,10 @@ class BlockingFileError(Exception):
def make_handler_for(node, parentnode=None, name=None):
if parentnode:
assert IDirectoryNode.providedBy(parentnode)
if IFileNode.providedBy(node):
return FileNodeHandler(node, parentnode, name)
if IMutableFileNode.providedBy(node):
return FileNodeHandler(node, parentnode, name)
if IFileNode.providedBy(node):
return FileNodeHandler(node, parentnode, name)
if IDirectoryNode.providedBy(node):
return DirectoryNodeHandler(node, parentnode, name)
raise WebError("Cannot provide handler for '%s'" % node)