Commit bf317058 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

docs unittest: Make _ReadDocFile a global function


Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent f6ce0ba2
......@@ -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]")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment