Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
...@@ -38,19 +38,20 @@ import testutils ...@@ -38,19 +38,20 @@ import testutils
VALID_URI_RE = re.compile(r"^[-/a-z0-9]*$") VALID_URI_RE = re.compile(r"^[-/a-z0-9]*$")
class TestDocs(unittest.TestCase): def _ReadDocFile(filename):
"""Documentation tests""" 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): def testHookDocs(self):
"""Check whether all hooks are documented. """Check whether all hooks are documented.
""" """
hooksdoc = self._ReadDocFile("hooks.rst") hooksdoc = _ReadDocFile("hooks.rst")
# Reverse mapping from LU to opcode # Reverse mapping from LU to opcode
lu2opcode = dict((lu, op) lu2opcode = dict((lu, op)
...@@ -103,7 +104,7 @@ class TestDocs(unittest.TestCase): ...@@ -103,7 +104,7 @@ class TestDocs(unittest.TestCase):
"""Check whether all RAPI resources are documented. """Check whether all RAPI resources are documented.
""" """
rapidoc = self._ReadDocFile("rapi.rst") rapidoc = _ReadDocFile("rapi.rst")
node_name = re.escape("[node_name]") node_name = re.escape("[node_name]")
instance_name = re.escape("[instance_name]") instance_name = re.escape("[instance_name]")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment