lbry-sdk/tests/unit/lbrynet_daemon/test_docs.py
2019-01-24 00:13:15 -05:00

17 lines
574 B
Python

import docopt
import unittest
from lbrynet.extras.daemon.Daemon import Daemon
class DaemonDocsTests(unittest.TestCase):
def test_can_parse_api_method_docs(self):
failures = []
for name, fn in Daemon.callable_methods.items():
try:
docopt.docopt(fn.__doc__, ())
except docopt.DocoptLanguageError as err:
failures.append(f"invalid docstring for {name}, {err.message}")
except docopt.DocoptExit:
pass
if failures:
self.fail("\n" + "\n".join(failures))