#NEWLINE# def test_print_list_string( self ) : #NEWLINE# #INDENT# objs = [ _FakeResult ( 'k1' , 1 ) ] #NEWLINE# field_labels = [ 'Another Name' , 'Another Value' ] #NEWLINE# orig = sys . stdout #NEWLINE# sys . stdout = six . StringIO ( ) #NEWLINE# cliutils . print_list ( objs , [ 'Name' , 'Value' ] , sortby_index = 0 , field_labels = field_labels ) #NEWLINE# out = sys . stdout . getvalue ( ) #NEWLINE# sys . stdout . close ( ) #NEWLINE# sys . stdout = orig #NEWLINE# expected = '+--------------+---------------+\n| Another Name | Another Value |\n+--------------+---------------+\n| k1           | 1             |\n+--------------+---------------+\n' #NEWLINE# self . assertEqual ( expected , out )