Skip to content

Commit

Permalink
Merge branch 'tgolly-patch-1' into develop
Browse files Browse the repository at this point in the history
* tgolly-patch-1:
  Add changelog entry for #829
  Add unittests for #829
  bugfix: convert ints to strings before write
  • Loading branch information
jamesls committed Jul 1, 2014
2 parents d421dc2 + 84ee524 commit f8cacf7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ Next Release (TBD)
a single item (e.g. ``--arg Param=[item]``) were not parsed
correctly.
(`issue 830 <https://github.com/aws/aws-cli/pull/830>`__)
* bugfix:Text output: Fix bug when rendering only
scalars that are numbers in text output
(`issue 829 <https://github.com/aws/aws-cli/pull/829>`__)
* bugfix:``aws cloudsearchdomain``: Fix bug where
``--endpoint-url`` is required even for ``help`` subcommands
(`issue 828 <https://github.com/aws/aws-cli/pull/828>`__)
Expand Down
2 changes: 1 addition & 1 deletion awscli/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def _format_text(item, stream, identifier=None, scalar_keys=None):
else:
# If it's not a list or a dict, we just write the scalar
# value out directly.
stream.write(item)
stream.write(six.text_type(item))
stream.write('\n')


Expand Down
9 changes: 9 additions & 0 deletions tests/unit/test_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@ def test_multiple_list_of_dicts(self):
'ZOO\t0\t1\t2\n'
)

def test_single_scalar_number(self):
self.assert_text_renders_to(10, '10\n')

def test_list_of_single_number(self):
self.assert_text_renders_to([10], '10\n')

def test_list_of_multiple_numbers(self):
self.assert_text_renders_to([10, 10, 10], '10\t10\t10\n')

def test_different_keys_in_sublists(self):
self.assert_text_renders_to(
# missing "b" adds "d"
Expand Down

0 comments on commit f8cacf7

Please sign in to comment.