commit e1cb6914c329ee3a562fc3cb756b240d02eb3fe1 Author: Damian Johnson atagar@torproject.org Date: Sun Jul 31 11:27:45 2016 -0700
Correct 'interpretor' typos
Oops, we still had quite a few of these typos throughout our codebase. --- stem/interpreter/__init__.py | 2 +- stem/interpreter/commands.py | 4 ++-- stem/interpreter/settings.cfg | 2 +- test/settings.cfg | 2 +- test/unit/interpreter/commands.py | 24 ++++++++++++------------ test/unit/interpreter/help.py | 2 +- 6 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/stem/interpreter/__init__.py b/stem/interpreter/__init__.py index 5031900..f516565 100644 --- a/stem/interpreter/__init__.py +++ b/stem/interpreter/__init__.py @@ -122,7 +122,7 @@ def main(): readline.set_completer(autocompleter.complete) readline.set_completer_delims('\n')
- interpreter = stem.interpreter.commands.ControlInterpretor(controller) + interpreter = stem.interpreter.commands.ControlInterpreter(controller)
for line in msg('msg.startup_banner').splitlines(): line_format = HEADER_BOLD_OUTPUT if line.startswith(' ') else HEADER_OUTPUT diff --git a/stem/interpreter/commands.py b/stem/interpreter/commands.py index 5c84723..82a216d 100644 --- a/stem/interpreter/commands.py +++ b/stem/interpreter/commands.py @@ -84,7 +84,7 @@ def _get_fingerprint(arg, controller): raise ValueError("'%s' isn't a fingerprint, nickname, or IP address" % arg)
-class ControlInterpretor(code.InteractiveConsole): +class ControlInterpreter(code.InteractiveConsole): """ Handles issuing requests and providing nicely formed responses, with support for special irc style subcommands. @@ -295,7 +295,7 @@ class ControlInterpretor(code.InteractiveConsole):
# Commands fall into three categories: # - # * Interpretor commands. These start with a '/'. + # * Interpreter commands. These start with a '/'. # # * Controller commands stem knows how to handle. We use our Controller's # methods for these to take advantage of caching and present nicer diff --git a/stem/interpreter/settings.cfg b/stem/interpreter/settings.cfg index 2739eec..1c6b27f 100644 --- a/stem/interpreter/settings.cfg +++ b/stem/interpreter/settings.cfg @@ -59,7 +59,7 @@ msg.starting_tor # Response for the '/help' command without any arguments.
help.general -|Interpretor commands include: +|Interpreter commands include: | /help - provides information for interpreter and tor commands | /events - prints events that we've received | /info - general information for a relay diff --git a/test/settings.cfg b/test/settings.cfg index 10e2ccf..b7323ac 100644 --- a/test/settings.cfg +++ b/test/settings.cfg @@ -206,7 +206,7 @@ test.unit_tests |test.unit.interpreter.arguments.TestArgumentParsing |test.unit.interpreter.autocomplete.TestAutocompletion |test.unit.interpreter.help.TestHelpResponses -|test.unit.interpreter.commands.TestInterpretorCommands +|test.unit.interpreter.commands.TestInterpreterCommands |test.unit.doctest.TestDocumentation
test.integ_tests diff --git a/test/unit/interpreter/commands.py b/test/unit/interpreter/commands.py index 1fe52f7..63fedc5 100644 --- a/test/unit/interpreter/commands.py +++ b/test/unit/interpreter/commands.py @@ -5,7 +5,7 @@ import stem import stem.response import stem.version
-from stem.interpreter.commands import ControlInterpretor, _get_fingerprint +from stem.interpreter.commands import ControlInterpreter, _get_fingerprint
from test import mocking from test.unit.interpreter import CONTROLLER @@ -40,7 +40,7 @@ EXPECTED_GETCONF_RESPONSE = """\ FINGERPRINT = '9695DFC35FFEB861329B9F1AB04C46397020CE31'
-class TestInterpretorCommands(unittest.TestCase): +class TestInterpreterCommands(unittest.TestCase): def test_get_fingerprint_for_ourselves(self): controller = Mock()
@@ -94,23 +94,23 @@ class TestInterpretorCommands(unittest.TestCase): controller = Mock() controller.is_alive.return_value = False
- interpreter = ControlInterpretor(controller) + interpreter = ControlInterpreter(controller) self.assertRaises(stem.SocketClosed, interpreter.run_command, '/help')
def test_quit(self): - interpreter = ControlInterpretor(CONTROLLER) + interpreter = ControlInterpreter(CONTROLLER) self.assertRaises(stem.SocketClosed, interpreter.run_command, '/quit') self.assertRaises(stem.SocketClosed, interpreter.run_command, 'QUIT')
def test_help(self): - interpreter = ControlInterpretor(CONTROLLER) + interpreter = ControlInterpreter(CONTROLLER)
- self.assertTrue('Interpretor commands include:' in interpreter.run_command('/help')) + self.assertTrue('Interpreter commands include:' in interpreter.run_command('/help')) self.assertTrue('Queries the tor process for information.' in interpreter.run_command('/help GETINFO')) self.assertTrue('Queries the tor process for information.' in interpreter.run_command('/help GETINFO version'))
def test_events(self): - interpreter = ControlInterpretor(CONTROLLER) + interpreter = ControlInterpreter(CONTROLLER)
# no received events
@@ -157,11 +157,11 @@ class TestInterpretorCommands(unittest.TestCase): server_desc.tor_version = stem.version.Version('0.2.5.4-alpha-dev') server_desc.contact = '1024D/28988BF5 arma mit edu'
- interpreter = ControlInterpretor(controller) + interpreter = ControlInterpreter(controller) self.assertTrue(interpreter.run_command('/info ' + FINGERPRINT).startswith(EXPECTED_INFO_RESPONSE))
def test_unrecognized_interpreter_command(self): - interpreter = ControlInterpretor(CONTROLLER) + interpreter = ControlInterpreter(CONTROLLER)
expected = "\x1b[1;31m'/unrecognized' isn't a recognized command\x1b[0m\n" self.assertEqual(expected, interpreter.run_command('/unrecognized')) @@ -172,7 +172,7 @@ class TestInterpretorCommands(unittest.TestCase): controller = Mock() controller.msg.return_value = mocking.get_message(response)
- interpreter = ControlInterpretor(controller) + interpreter = ControlInterpreter(controller)
self.assertEqual('\x1b[34m250-version=0.2.5.1-alpha-dev (git-245ecfff36c0cecc)\r\x1b[0m\n\x1b[34m250 OK\x1b[0m\n', interpreter.run_command('GETINFO version')) self.assertEqual('\x1b[34m250-version=0.2.5.1-alpha-dev (git-245ecfff36c0cecc)\r\x1b[0m\n\x1b[34m250 OK\x1b[0m\n', interpreter.run_command('GETINFO version')) @@ -187,7 +187,7 @@ class TestInterpretorCommands(unittest.TestCase): controller = Mock() controller.msg.return_value = mocking.get_message(response)
- interpreter = ControlInterpretor(controller) + interpreter = ControlInterpreter(controller)
self.assertEqual('\x1b[34m250-Log=notice stdout\r\x1b[0m\n\x1b[34m250 Address\x1b[0m\n', interpreter.run_command('GETCONF log address')) controller.msg.assert_called_with('GETCONF log address') @@ -196,6 +196,6 @@ class TestInterpretorCommands(unittest.TestCase): controller = Mock() controller.msg.return_value = mocking.get_message('250 OK')
- interpreter = ControlInterpretor(controller) + interpreter = ControlInterpreter(controller)
self.assertEqual('\x1b[34m250 OK\x1b[0m\n', interpreter.run_command('SETEVENTS BW')) diff --git a/test/unit/interpreter/help.py b/test/unit/interpreter/help.py index 49df746..b37a09b 100644 --- a/test/unit/interpreter/help.py +++ b/test/unit/interpreter/help.py @@ -25,7 +25,7 @@ class TestHelpResponses(unittest.TestCase):
def test_general_help(self): result = response(CONTROLLER, '') - self.assertTrue('Interpretor commands include:' in result) + self.assertTrue('Interpreter commands include:' in result) self.assertTrue('\x1b[34;1m GETINFO\x1b[0m\x1b[34m - queries information from tor\x1b[0m\n' in result)
def test_getinfo_help(self):
tor-commits@lists.torproject.org