moved tests/unit/lbrynet_daemon/test_docs.py into tests/unit/test_cli.py

This commit is contained in:
Lex Berezhny 2019-01-23 21:59:26 -05:00
parent afff362544
commit c2b9909397
2 changed files with 20 additions and 18 deletions

View file

@ -1,17 +0,0 @@
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))

View file

@ -1,9 +1,13 @@
import contextlib
from io import StringIO
from unittest import TestCase
import docopt
from torba.testcase import AsyncioTestCase
from lbrynet.extras.cli import normalize_value, main
from lbrynet.extras.system_info import get_platform
from torba.testcase import AsyncioTestCase
from lbrynet.extras.daemon.Daemon import Daemon
class CLITest(AsyncioTestCase):
@ -114,3 +118,18 @@ class CLITest(AsyncioTestCase):
"wallet_balance is deprecated, using account_balance.\n"
"Could not connect to daemon. Are you sure it's running?"
)
class DaemonDocsTests(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))