Skip to content

Commit

Permalink
Cleaned up topic code after pr-check script
Browse files Browse the repository at this point in the history
  • Loading branch information
kyleknap committed Mar 6, 2015
1 parent ee55b8f commit 5bf0ae6
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion awscli/clidocs.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ def _remove_tags_from_content(self, filename):
break

# Join all of the non-tagged lines back together.
return ''.join(lines[i:])
return ''.join(lines[content_begin_index:])

def _line_has_tag(self, line):
for tag in self._topic_tag_db.valid_tags:
Expand Down
6 changes: 3 additions & 3 deletions awscli/help.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def name(self):
@property
def subcommand_table(self):
"""These are the commands that may follow after the help command"""
return self._subcommand_table
return self._subcommand_table

@property
def related_items(self):
Expand All @@ -233,8 +233,8 @@ def __call__(self, args, parsed_globals):
subcommand_parser = ArgTableArgParser({}, self.subcommand_table)
parsed, remaining = subcommand_parser.parse_known_args(args)
if getattr(parsed, 'subcommand', None) is not None:
return self.subcommand_table[parsed.subcommand](remaining,
parsed_globals)
return self.subcommand_table[parsed.subcommand](remaining,
parsed_globals)

# Create an event handler for a Provider Document
instance = self.EventHandlerClass(self)
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/docs/test_help_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def test_custom_operation_help_output(self):
self.assert_contains('.. _cli:aws s3 ls:')
self.assert_contains('List S3 objects')
self.assert_contains('--summarize')

def test_topic_list_help_output(self):
self.driver.main(['help', 'topics'])
# Should contain the title
Expand Down
11 changes: 5 additions & 6 deletions tests/unit/test_clidocs.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
TopicDocumentEventHandler
from awscli.help import ServiceHelpCommand, TopicListerCommand, \
TopicHelpCommand
from awscli.topictags import TopicTagDB


class TestRecursiveShapes(unittest.TestCase):
Expand Down Expand Up @@ -239,9 +238,9 @@ def test_description(self):

def test_subitems_start(self):
ref_output = [
'-------\nGeneral\n-------',
'-------\nGeneral\n-------',
('* topic-name-1: %s\n'
'* topic-name-3: %s\n' %
'* topic-name-3: %s\n' %
(self.descriptions[0], self.descriptions[2])),
'--\nS3\n--',
'* topic-name-2: %s\n' % self.descriptions[1]
Expand All @@ -258,9 +257,9 @@ def test_subitems_start(self):
def test_subitems_start_html(self):
self.cmd.doc.target = 'html'
ref_output = [
'-------\nGeneral\n-------',
'-------\nGeneral\n-------',
('* :ref:`topic-name-1 <cli:aws help topic-name-1>`: %s\n'
'* :ref:`topic-name-3 <cli:aws help topic-name-3>`: %s\n' %
'* :ref:`topic-name-3 <cli:aws help topic-name-3>`: %s\n' %
(self.descriptions[0], self.descriptions[2])),
'--\nS3\n--',
('* :ref:`topic-name-2 <cli:aws help topic-name-2>`: %s\n' %
Expand All @@ -269,7 +268,7 @@ def test_subitems_start_html(self):

self.doc_handler.doc_subitems_start(self.cmd)
contents = self.cmd.doc.getvalue().decode('utf-8')

for line in ref_output:
self.assertIn(line, contents)
# Make sure the hidden toctree is in the html
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
from awscli.help import PosixHelpRenderer, ExecutableNotFoundError
from awscli.help import WindowsHelpRenderer, ProviderHelpCommand, HelpCommand
from awscli.help import TopicListerCommand, TopicHelpCommand
from awscli.topictags import TopicTagDB


class HelpSpyMixin(object):
Expand Down Expand Up @@ -126,6 +125,7 @@ def setUp(self):
def tearDown(self):
self.file_creator.remove_all()


class TestHelpCommand(TestHelpCommandBase):
"""Test some of the deeper functionality of the HelpCommand
Expand Down

0 comments on commit 5bf0ae6

Please sign in to comment.