fixed my silly mistakes

This commit is contained in:
Alex Grintsvayg 2017-03-09 07:58:36 -05:00
parent 63cb2cf571
commit 3f4a4728e6
2 changed files with 5 additions and 8 deletions

View file

@ -7,7 +7,6 @@ import base58
import requests import requests
import urllib import urllib
import simplejson as json import simplejson as json
import textwrap
from requests import exceptions as requests_exceptions from requests import exceptions as requests_exceptions
from decimal import Decimal from decimal import Decimal
import random import random
@ -1326,7 +1325,6 @@ class Daemon(AuthJSONRPCServer):
return d return d
@defer.inlineCallbacks
def jsonrpc_help(self, command=None): def jsonrpc_help(self, command=None):
""" """
Return a useful message for an API command Return a useful message for an API command
@ -1339,14 +1337,13 @@ class Daemon(AuthJSONRPCServer):
""" """
if command is None: if command is None:
yield { return self._render_response({
'about': 'This is the LBRY JSON-RPC API', 'about': 'This is the LBRY JSON-RPC API',
'command_help': 'Pass a `command` parameter to this method to see ' + 'command_help': 'Pass a `command` parameter to this method to see ' +
'help for that command (e.g. `help command=resolve_name`)', 'help for that command (e.g. `help command=resolve_name`)',
'command_list': 'Get a full list of commands using the `commands` method', 'command_list': 'Get a full list of commands using the `commands` method',
'more_info': 'Visit https://lbry.io/api for more info', 'more_info': 'Visit https://lbry.io/api for more info',
} })
return
fn = self.callable_methods.get(command) fn = self.callable_methods.get(command)
if fn is None: if fn is None:
@ -1354,9 +1351,9 @@ class Daemon(AuthJSONRPCServer):
"No help available for '{}'. It is not a valid command.".format(command) "No help available for '{}'. It is not a valid command.".format(command)
) )
yield { return self._render_response({
'help': fn.__doc__ 'help': fn.__doc__
} })
def jsonrpc_commands(self): def jsonrpc_commands(self):
""" """

View file

@ -136,5 +136,5 @@ class TestJsonRpc(unittest.TestCase):
def test_help(self): def test_help(self):
d = defer.maybeDeferred(self.test_daemon.jsonrpc_help, command='status') d = defer.maybeDeferred(self.test_daemon.jsonrpc_help, command='status')
d.addCallback(lambda result: self.assertSubstring('daemon status', result)) d.addCallback(lambda result: self.assertSubstring('daemon status', result['help']))
# self.assertSubstring('daemon status', d.result) # self.assertSubstring('daemon status', d.result)