mirror of https://github.com/scrapy/scrapy.git
Style changes
This commit is contained in:
parent
5f9931d2ad
commit
441e1e750f
|
|
@ -52,7 +52,6 @@ class TelnetConsole(protocol.ServerFactory):
|
|||
self.noisy = False
|
||||
self.portrange = [int(x) for x in crawler.settings.getlist('TELNETCONSOLE_PORT')]
|
||||
self.host = crawler.settings['TELNETCONSOLE_HOST']
|
||||
|
||||
self.username = crawler.settings['TELNETCONSOLE_USERNAME']
|
||||
self.password = crawler.settings['TELNETCONSOLE_PASSWORD']
|
||||
|
||||
|
|
@ -113,7 +112,7 @@ class TelnetConsole(protocol.ServerFactory):
|
|||
'prefs': print_live_refs,
|
||||
'hpy': hpy,
|
||||
'help': "This is Scrapy telnet console. For more info see: "
|
||||
"https://doc.scrapy.org/en/latest/topics/telnetconsole.html",
|
||||
"https://doc.scrapy.org/en/latest/topics/telnetconsole.html",
|
||||
}
|
||||
self.crawler.signals.send_catch_log(update_telnet_vars, telnet_vars=telnet_vars)
|
||||
return telnet_vars
|
||||
|
|
|
|||
|
|
@ -12,17 +12,15 @@ from scrapy.extensions.telnet import TelnetConsole, logger
|
|||
from scrapy.utils.test import get_crawler
|
||||
|
||||
|
||||
class TelnetExtensionTest(unittest.TestCase):
|
||||
class TelnetExtensionTest(unittest.TestCase):
|
||||
def _get_console_and_portal(self, settings=None):
|
||||
crawler = get_crawler(settings_dict=settings)
|
||||
console = TelnetConsole(crawler)
|
||||
username = console.username
|
||||
password = console.password
|
||||
|
||||
def _get_telnet_vars():
|
||||
# This function has some side effects we don't need for this test
|
||||
return {}
|
||||
console._get_telnet_vars = _get_telnet_vars
|
||||
# This function has some side effects we don't need for this test
|
||||
console._get_telnet_vars = lambda: {}
|
||||
|
||||
console.start_listening()
|
||||
protocol = console.protocol()
|
||||
|
|
|
|||
Loading…
Reference in New Issue