From bf317058c3b3ed549e9361d1bd46ef380266f640 Mon Sep 17 00:00:00 2001 From: Michael Hanselmann <hansmi@google.com> Date: Wed, 14 Sep 2011 12:23:36 +0200 Subject: [PATCH] docs unittest: Make _ReadDocFile a global function Signed-off-by: Michael Hanselmann <hansmi@google.com> Reviewed-by: Iustin Pop <iustin@google.com> --- test/docs_unittest.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/test/docs_unittest.py b/test/docs_unittest.py index 82e5a9d06..a67370559 100755 --- a/test/docs_unittest.py +++ b/test/docs_unittest.py @@ -38,19 +38,20 @@ import testutils VALID_URI_RE = re.compile(r"^[-/a-z0-9]*$") -class TestDocs(unittest.TestCase): - """Documentation tests""" +def _ReadDocFile(filename): + return utils.ReadFile("%s/doc/%s" % + (testutils.GetSourceDir(), filename)) - @staticmethod - def _ReadDocFile(filename): - return utils.ReadFile("%s/doc/%s" % - (testutils.GetSourceDir(), filename)) +class TestDocs(unittest.TestCase): + """Documentation tests. + + """ def testHookDocs(self): """Check whether all hooks are documented. """ - hooksdoc = self._ReadDocFile("hooks.rst") + hooksdoc = _ReadDocFile("hooks.rst") # Reverse mapping from LU to opcode lu2opcode = dict((lu, op) @@ -103,7 +104,7 @@ class TestDocs(unittest.TestCase): """Check whether all RAPI resources are documented. """ - rapidoc = self._ReadDocFile("rapi.rst") + rapidoc = _ReadDocFile("rapi.rst") node_name = re.escape("[node_name]") instance_name = re.escape("[instance_name]") -- GitLab