1111import tempfile
1212
1313import click
14+ from rich .table import Table
1415from unittest import mock as mock
1516
1617from SoftLayer .CLI import core
@@ -266,19 +267,6 @@ def test_format_output_string(self):
266267 t = formatting .format_output ('just a string' , 'raw' )
267268 self .assertEqual ('just a string' , t )
268269
269- t = formatting .format_output (b'just a string' , 'raw' )
270- self .assertEqual (b'just a string' , t )
271-
272- def test_format_output_raw (self ):
273- t = formatting .Table (['nothing' ])
274- t .align ['nothing' ] = 'c'
275- t .add_row (['testdata' ])
276- t .sortby = 'nothing'
277- ret = formatting .format_output (t , 'raw' )
278-
279- self .assertNotIn ('nothing' , str (ret ))
280- self .assertIn ('testdata' , str (ret ))
281-
282270 def test_format_output_json (self ):
283271 t = formatting .Table (['nothing' ])
284272 t .align ['nothing' ] = 'c'
@@ -342,21 +330,19 @@ def test_format_output_formatted_item(self):
342330 def test_format_output_list (self ):
343331 item = ['this' , 'is' , 'a' , 'list' ]
344332 ret = formatting .format_output (item , 'table' )
345- self .assertEqual (os . linesep . join ( item ), ret )
333+ self .assertEqual ("['this', 'is', 'a', 'list']" , str ( ret ) )
346334
347335 def test_format_output_table (self ):
348336 t = formatting .Table (['nothing' ])
349337 t .align ['nothing' ] = 'c'
350338 t .add_row (['testdata' ])
351339 t .sortby = 'nothing'
352340 ret = formatting .format_output (t , 'table' )
353-
354- self .assertIn ('nothing' , str (ret ))
355- self .assertIn ('testdata' , str (ret ))
341+ self .assertIsInstance (ret , Table )
356342
357343 def test_unknown (self ):
358344 t = formatting .format_output ({}, 'raw' )
359- self .assertEqual ({} , t )
345+ self .assertEqual ('{}' , t )
360346
361347 def test_sequentialoutput (self ):
362348 # specifying the separator prevents windows from using \n\r
@@ -380,7 +366,7 @@ def test_format_output_python(self):
380366 self .assertEqual (['just a string' ], t )
381367
382368 t = formatting .format_output ({'test_key' : 'test_value' }, 'python' )
383- self .assertEqual ({'test_key' : 'test_value' }, t )
369+ self .assertEqual (" {'test_key': 'test_value'}" , t )
384370
385371 def test_format_output_python_keyvaluetable (self ):
386372 t = formatting .KeyValueTable (['key' , 'value' ])
0 commit comments