move docs tests to own file
This commit is contained in:
parent
c089f1954a
commit
2655797692
2 changed files with 17 additions and 16 deletions
|
@ -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))
|
||||
|
|
17
lbrynet/tests/unit/lbrynet_daemon/test_docs.py
Normal file
17
lbrynet/tests/unit/lbrynet_daemon/test_docs.py
Normal file
|
@ -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))
|
Loading…
Add table
Reference in a new issue