Skip to content

Commit

Permalink
Fix output tests for core and pin tabulate version (Azure#3313)
Browse files Browse the repository at this point in the history
  • Loading branch information
troydai authored May 10, 2017
1 parent c4f6127 commit e84f34e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 18 deletions.
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,4 @@ pyyaml==3.11
requests==2.9.1
setuptools==30.4.0
six==1.10.0
tabulate==0.7.5
vcrpy==1.10.3
2 changes: 1 addition & 1 deletion src/azure-cli-core/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
'pyyaml',
'requests',
'six',
'tabulate',
'tabulate==0.7.7',
]

if sys.version_info < (3, 4):
Expand Down
23 changes: 7 additions & 16 deletions src/azure-cli-core/tests/test_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,7 @@
import azure.cli.core.util as util


class TestOutput(unittest.TestCase):

@classmethod
def setUpClass(cls):
pass

@classmethod
def tearDownClass(cls):
pass

class TestCoreCLIOutput(unittest.TestCase):
def setUp(self):
self.io = StringIO()

Expand Down Expand Up @@ -85,9 +76,9 @@ def test_out_table(self):
obj['val'] = '0b1f6472'
output_producer.out(CommandResultItem(obj))
self.assertEqual(util.normalize_newlines(self.io.getvalue()), util.normalize_newlines(
""" Active Val
"""Active Val
-------- --------
1 0b1f6472
True 0b1f6472
"""))

def test_out_table_list_of_lists(self):
Expand Down Expand Up @@ -122,9 +113,9 @@ def test_out_table_no_query_no_transformer_order(self):
output_producer.out(result_item)
# Should be alphabetical order as no table transformer and query is not active.
self.assertEqual(util.normalize_newlines(self.io.getvalue()), util.normalize_newlines(
""" Active Name Sub Val
"""Active Name Sub Val
-------- ------ -------- --------------
1 qwerty 0b1f6472 0b1f6472qwerty
True qwerty 0b1f6472 0b1f6472qwerty
"""))

def test_out_table_no_query_yes_transformer_order(self):
Expand All @@ -139,9 +130,9 @@ def transformer(r):
output_producer.out(result_item)
# Should be table transformer order
self.assertEqual(util.normalize_newlines(self.io.getvalue()), util.normalize_newlines(
"""Name Val Active Sub
"""Name Val Active Sub
------ -------------- -------- --------
qwerty 0b1f6472qwerty 1 0b1f6472
qwerty 0b1f6472qwerty True 0b1f6472
"""))

# TSV output tests
Expand Down

0 comments on commit e84f34e

Please sign in to comment.