From 2655797692907edf7139e8a4df20654d81d93476 Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Thu, 12 Apr 2018 14:04:22 -0400 Subject: [PATCH] move docs tests to own file --- .../tests/unit/lbrynet_daemon/test_DaemonCLI.py | 16 ---------------- lbrynet/tests/unit/lbrynet_daemon/test_docs.py | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 16 deletions(-) create mode 100644 lbrynet/tests/unit/lbrynet_daemon/test_docs.py diff --git a/lbrynet/tests/unit/lbrynet_daemon/test_DaemonCLI.py b/lbrynet/tests/unit/lbrynet_daemon/test_DaemonCLI.py index abe487b97..5054c8912 100644 --- a/lbrynet/tests/unit/lbrynet_daemon/test_DaemonCLI.py +++ b/lbrynet/tests/unit/lbrynet_daemon/test_DaemonCLI.py @@ -1,7 +1,5 @@ -import docopt from twisted.trial import unittest from lbrynet.daemon import DaemonCLI -from lbrynet.daemon.Daemon import Daemon class DaemonCLITests(unittest.TestCase): @@ -31,17 +29,3 @@ class DaemonCLITests(unittest.TestCase): self.assertEqual('3', DaemonCLI.guess_type('3', key="channel_name")) self.assertEqual(3, DaemonCLI.guess_type('3', key="some_other_thing")) - - -class DaemonDocsTests(unittest.TestCase): - def test_can_parse_api_method_docs(self): - failures = [] - for name, fn in Daemon.callable_methods.iteritems(): - 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)) diff --git a/lbrynet/tests/unit/lbrynet_daemon/test_docs.py b/lbrynet/tests/unit/lbrynet_daemon/test_docs.py new file mode 100644 index 000000000..ba246ed95 --- /dev/null +++ b/lbrynet/tests/unit/lbrynet_daemon/test_docs.py @@ -0,0 +1,17 @@ +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.iteritems(): + 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))