Skip to content

Commit

Permalink
Fix typos in console and tests (#436)
Browse files Browse the repository at this point in the history
  • Loading branch information
yarikoptic committed Feb 13, 2023
1 parent 71743b6 commit 527e3d0
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions fire/console/console_attr.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ def __init__(self, encoding=None, suppress_output=False):

# ANSI "standard" attributes.
if self.SupportsAnsi():
# Select Graphic Rendition paramaters from
# Select Graphic Rendition parameters from
# http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
# Italic '3' would be nice here but its not widely supported.
self._csi = '\x1b['
Expand Down Expand Up @@ -394,7 +394,7 @@ def GetControlSequenceIndicator(self):
"""Returns the control sequence indicator string.
Returns:
The conrol sequence indicator string or None if control sequences are not
The control sequence indicator string or None if control sequences are not
supported.
"""
return self._csi
Expand All @@ -408,7 +408,7 @@ def GetControlSequenceLen(self, buf):
buf: The string to check for a control sequence.
Returns:
The conrol sequence length at the beginning of buf or 0 if buf does not
The control sequence length at the beginning of buf or 0 if buf does not
start with a control sequence.
"""
if not self._csi or not buf.startswith(self._csi):
Expand Down
2 changes: 1 addition & 1 deletion fire/console/console_attr_os.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def _GetTermSizeEnvironment():


def _GetTermSizeTput():
"""Returns the terminal x and y dimemsions from tput(1)."""
"""Returns the terminal x and y dimensions from tput(1)."""
import subprocess # pylint: disable=g-import-not-at-top
output = encoding.Decode(subprocess.check_output(['tput', 'cols'],
stderr=subprocess.STDOUT))
Expand Down
2 changes: 1 addition & 1 deletion fire/console/console_pager.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def __init__(self, contents, out=None, prompt=None):
Args:
contents: The entire contents of the text lines to page.
out: The output stream, log.out (effectively) if None.
prompt: The page break prompt, a defalt prompt is used if None..
prompt: The page break prompt, a default prompt is used if None..
"""
self._contents = contents
self._out = out or sys.stdout
Expand Down
12 changes: 6 additions & 6 deletions fire/docstrings_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,38 +50,38 @@ def test_one_line_simple_whitespace(self):

def test_one_line_too_long(self):
# pylint: disable=line-too-long
docstring = """A one line docstring thats both a little too verbose and a little too long so it keeps going well beyond a reasonable length for a one-liner.
docstring = """A one line docstring that is both a little too verbose and a little too long so it keeps going well beyond a reasonable length for a one-liner.
"""
# pylint: enable=line-too-long
docstring_info = docstrings.parse(docstring)
expected_docstring_info = DocstringInfo(
summary='A one line docstring thats both a little too verbose and '
summary='A one line docstring that is both a little too verbose and '
'a little too long so it keeps going well beyond a reasonable length '
'for a one-liner.',
)
self.assertEqual(expected_docstring_info, docstring_info)

def test_one_line_runs_over(self):
# pylint: disable=line-too-long
docstring = """A one line docstring thats both a little too verbose and a little too long
docstring = """A one line docstring that is both a little too verbose and a little too long
so it runs onto a second line.
"""
# pylint: enable=line-too-long
docstring_info = docstrings.parse(docstring)
expected_docstring_info = DocstringInfo(
summary='A one line docstring thats both a little too verbose and '
summary='A one line docstring that is both a little too verbose and '
'a little too long so it runs onto a second line.',
)
self.assertEqual(expected_docstring_info, docstring_info)

def test_one_line_runs_over_whitespace(self):
docstring = """
A one line docstring thats both a little too verbose and a little too long
A one line docstring that is both a little too verbose and a little too long
so it runs onto a second line.
"""
docstring_info = docstrings.parse(docstring)
expected_docstring_info = DocstringInfo(
summary='A one line docstring thats both a little too verbose and '
summary='A one line docstring that is both a little too verbose and '
'a little too long so it runs onto a second line.',
)
self.assertEqual(expected_docstring_info, docstring_info)
Expand Down
4 changes: 2 additions & 2 deletions fire/parser_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ def testDefaultParseValueBareWordsTuple(self):

def testDefaultParseValueNestedContainers(self):
self.assertEqual(
parser.DefaultParseValue('[(A, 2, "3"), 5, {alph: 10.2, beta: "cat"}]'),
[('A', 2, '3'), 5, {'alph': 10.2, 'beta': 'cat'}])
parser.DefaultParseValue('[(A, 2, "3"), 5, {alpha: 10.2, beta: "cat"}]'),
[('A', 2, '3'), 5, {'alpha': 10.2, 'beta': 'cat'}])

def testDefaultParseValueComments(self):
self.assertEqual(parser.DefaultParseValue('"0#comments"'), '0#comments')
Expand Down

0 comments on commit 527e3d0

Please sign in to comment.