Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix output tests for core and pin tabulate version #3313

Merged
merged 1 commit into from
May 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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