def test_pretty_list_repr_str_list(self): lst = [ 'Apple', 'Banana', 'Tina\'s Pear', 'Red', 'Green', 'Blue'] lst_repr = utils.pretty_list_repr(lst, max_line_len=30) self.assertEqual(lst_repr, ('''[ 'Apple', 'Banana',\n''' ''' "Tina's Pear", 'Red',\n''' ''' 'Green', 'Blue']'''))
def test_pretty_list_format(self): lst = [123.92704029, 1.98628919, 20.99657472, 6.69566871, 5.0193061] lst_repr = utils.pretty_list_repr(lst, max_line_len=20, value_format='{0:.3f}') self.assertEqual(lst_repr, '[123.927, 1.986,\n 20.997, 6.696,\n 5.019]')
def test_pretty_list_format(): lst = [123.92704029, 1.98628919, 20.99657472, 6.69566871, 5.0193061] lst_repr = utils.pretty_list_repr(lst, max_line_len=20, value_format="{0:.3f}") expected_repr = "[123.927, 1.986,\n 20.997, 6.696,\n 5.019]" assert lst_repr == expected_repr
def test_pretty_list_repr_str_list(): lst = ["Apple", "Banana", "Tina's Pear", "Red", "Green", "Blue"] lst_repr = utils.pretty_list_repr(lst, max_line_len=30) assert lst_repr == ( """[ 'Apple', 'Banana',\n""" """ "Tina's Pear", 'Red',\n""" """ 'Green', 'Blue']""" )
def test_pretty_list_repr_no_wrap(): lst = [8, 3, 3, 14, 4, 4, 6, 5, 14, 9, 13, 2, 18, 10, 4, 15, 12] assert utils.pretty_list_repr(lst, max_line_len=80) == ( '[ 8, 3, 3, 14, 4, 4, 6, 5, 14, 9,' ' 13, 2, 18, 10, 4, 15, 12]' )
def test_pretty_waveform_repr_empty_list(self): lst = [] lst_repr = utils.pretty_list_repr(lst) self.assertEqual(lst_repr, '[]')
def test_pretty_list_repr_str_list(self): lst = ['Apple', 'Banana', 'Tina\'s Pear', 'Red', 'Green', 'Blue'] lst_repr = utils.pretty_list_repr(lst, max_line_len=30) self.assertEqual(lst_repr, ('''[ 'Apple', 'Banana',\n''' ''' "Tina's Pear", 'Red',\n''' ''' 'Green', 'Blue']'''))
def test_pretty_list_repr_no_wrap(self): lst = [8, 3, 3, 14, 4, 4, 6, 5, 14, 9, 13, 2, 18, 10, 4, 15, 12] self.assertEqual(utils.pretty_list_repr(lst, max_line_len=80), ('[ 8, 3, 3, 14, 4, 4, 6, 5, 14, 9,' ' 13, 2, 18, 10, 4, 15, 12]'))
def test_pretty_waveform_repr_empty_list(): lst = [] lst_repr = utils.pretty_list_repr(lst) assert lst_repr == "[]"
def test_pretty_list_repr_no_wrap(): lst = [8, 3, 3, 14, 4, 4, 6, 5, 14, 9, 13, 2, 18, 10, 4, 15, 12] assert utils.pretty_list_repr( lst, max_line_len=80) == ("[ 8, 3, 3, 14, 4, 4, 6, 5, 14, 9," " 13, 2, 18, 10, 4, 15, 12]")
def test_pretty_list_format(self): lst = [ 123.92704029, 1.98628919, 20.99657472, 6.69566871, 5.0193061 ] lst_repr = utils.pretty_list_repr(lst, max_line_len=20, value_format='{0:.3f}') self.assertEqual(lst_repr, '[123.927, 1.986,\n 20.997, 6.696,\n 5.019]')
def test_pretty_list_repr_no_wrap(self): lst = [ 8, 3, 3, 14, 4, 4, 6, 5, 14, 9, 13, 2, 18, 10, 4, 15, 12] self.assertEqual(utils.pretty_list_repr(lst, max_line_len=80), ('[ 8, 3, 3, 14, 4, 4, 6, 5, 14, 9,' ' 13, 2, 18, 10, 4, 15, 12]'))
def test_pretty_list_repr_empty_list(): lst = [] lst_repr = utils.pretty_list_repr(lst) assert lst_repr == "[]"
def test_pretty_list_format(): lst = [123.92704029, 1.98628919, 20.99657472, 6.69566871, 5.0193061] lst_repr = utils.pretty_list_repr(lst, max_line_len=20, value_format='{0:.3f}') expected_repr = '[123.927, 1.986,\n 20.997, 6.696,\n 5.019]' assert lst_repr == expected_repr
def test_pretty_list_repr_str_list(): lst = ["Apple", "Banana", "Tina's Pear", "Red", "Green", "Blue"] lst_repr = utils.pretty_list_repr(lst, max_line_len=30) assert lst_repr == ("""[ 'Apple', 'Banana',\n""" """ "Tina's Pear", 'Red',\n""" """ 'Green', 'Blue']""")
def test_pretty_waveform_repr_empty_list(): lst = [] lst_repr = utils.pretty_list_repr(lst) assert lst_repr == '[]'
def test_pretty_list_repr(): lst = [8, 3, 3, 14, 4, 4, 6, 5, 14, 9, 13, 2, 18, 10, 4, 15, 12] assert utils.pretty_list_repr(lst, max_line_len=40) == ( "[ 8, 3, 3, 14, 4, 4, 6, 5, 14, 9,\n" " 13, 2, 18, 10, 4, 15, 12]" )