forked from LBRYCommunity/lbry-sdk
17 lines
592 B
Python
17 lines
592 B
Python
import docopt
|
|
from twisted.trial import unittest
|
|
from lbrynet.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("invalid docstring for %s, %s" % (name, err.message))
|
|
except docopt.DocoptExit:
|
|
pass
|
|
if failures:
|
|
self.fail("\n" + "\n".join(failures))
|