From c2b99093978ba040e93b8c3809e2009841914fd3 Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Wed, 23 Jan 2019 21:59:26 -0500 Subject: [PATCH] moved tests/unit/lbrynet_daemon/test_docs.py into tests/unit/test_cli.py --- tests/unit/lbrynet_daemon/test_docs.py | 17 ----------------- tests/unit/test_cli.py | 21 ++++++++++++++++++++- 2 files changed, 20 insertions(+), 18 deletions(-) delete mode 100644 tests/unit/lbrynet_daemon/test_docs.py diff --git a/tests/unit/lbrynet_daemon/test_docs.py b/tests/unit/lbrynet_daemon/test_docs.py deleted file mode 100644 index 1d462e66a..000000000 --- a/tests/unit/lbrynet_daemon/test_docs.py +++ /dev/null @@ -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)) diff --git a/tests/unit/test_cli.py b/tests/unit/test_cli.py index e7123430e..c8c105655 100644 --- a/tests/unit/test_cli.py +++ b/tests/unit/test_cli.py @@ -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))