diff --git a/newsfragments/3436.minor b/newsfragments/3436.minor new file mode 100644 index 000000000..e69de29bb diff --git a/src/allmydata/test/web/test_util.py b/src/allmydata/test/web/test_util.py index 8c48c20a5..24f865ebc 100644 --- a/src/allmydata/test/web/test_util.py +++ b/src/allmydata/test/web/test_util.py @@ -4,9 +4,6 @@ from ..common import ShouldFailMixin from .. import common_util as testutil class Util(ShouldFailMixin, testutil.ReallyEqualMixin, unittest.TestCase): - def test_load_file(self): - # This will raise an exception unless a well-formed XML file is found under that name. - common.getxmlfile('directory.xhtml').load() def test_parse_replace_arg(self): self.failUnlessReallyEqual(common.parse_replace_arg("true"), True) diff --git a/src/allmydata/web/common.py b/src/allmydata/web/common.py index 6035e2884..c1bddae86 100644 --- a/src/allmydata/web/common.py +++ b/src/allmydata/web/common.py @@ -3,21 +3,40 @@ import time import json from functools import wraps -from twisted.web import http, server, resource, template +from twisted.web import ( + http, + resource, + server, + template, +) from twisted.python import log -from nevow import loaders, appserver +from nevow import appserver from nevow.rend import Page from nevow.inevow import IRequest -from nevow.util import resource_filename from allmydata import blacklist -from allmydata.interfaces import ExistingChildError, NoSuchChildError, \ - FileTooLargeError, NotEnoughSharesError, NoSharesError, \ - EmptyPathnameComponentError, MustBeDeepImmutableError, \ - MustBeReadonlyError, MustNotBeUnknownRWError, SDMF_VERSION, MDMF_VERSION +from allmydata.interfaces import ( + EmptyPathnameComponentError, + ExistingChildError, + FileTooLargeError, + MustBeDeepImmutableError, + MustBeReadonlyError, + MustNotBeUnknownRWError, + NoSharesError, + NoSuchChildError, + NotEnoughSharesError, + MDMF_VERSION, + SDMF_VERSION, +) from allmydata.mutable.common import UnrecoverableFileError from allmydata.util.hashutil import timing_safe_compare -from allmydata.util.time_format import format_time, format_delta -from allmydata.util.encodingutil import to_bytes, quote_output +from allmydata.util.time_format import ( + format_delta, + format_time, +) +from allmydata.util.encodingutil import ( + quote_output, + to_bytes, +) # Originally part of this module, so still part of its API: from .common_py3 import ( # noqa: F401 @@ -42,9 +61,6 @@ def get_filenode_metadata(filenode): metadata['size'] = size return metadata -def getxmlfile(name): - return loaders.xmlfile(resource_filename('allmydata.web', '%s' % name)) - def boolean_of_arg(arg): # TODO: "" if arg.lower() not in ("true", "t", "1", "false", "f", "0", "on", "off"):