@@ -316,7 +316,7 @@ def test_generate_row_exceptions():
316
316
tc .generate_row (row_data = row_data , is_header = False , ** kwargs )
317
317
assert "{} contains an unprintable character" .format (arg ) in str (excinfo .value )
318
318
319
- # data with too many columns
319
+ # Data with too many columns
320
320
row_data = ['Data 1' , 'Extra Column' ]
321
321
with pytest .raises (ValueError ) as excinfo :
322
322
tc .generate_row (row_data = row_data , is_header = False )
@@ -504,6 +504,17 @@ def test_simple_table_width():
504
504
assert st .total_width () == 34
505
505
506
506
507
+ def test_simple_generate_data_row_exceptions ():
508
+ column_1 = Column ("Col 1" )
509
+ tc = SimpleTable ([column_1 ])
510
+
511
+ # Data with too many columns
512
+ row_data = ['Data 1' , 'Extra Column' ]
513
+ with pytest .raises (ValueError ) as excinfo :
514
+ tc .generate_data_row (row_data = row_data )
515
+ assert "Length of row_data must match length of cols" in str (excinfo .value )
516
+
517
+
507
518
def test_bordered_table_creation ():
508
519
column_1 = Column ("Col 1" , width = 15 )
509
520
column_2 = Column ("Col 2" , width = 15 )
@@ -635,6 +646,17 @@ def test_bordered_table_width():
635
646
assert bt .total_width () == 37
636
647
637
648
649
+ def test_bordered_generate_data_row_exceptions ():
650
+ column_1 = Column ("Col 1" )
651
+ tc = BorderedTable ([column_1 ])
652
+
653
+ # Data with too many columns
654
+ row_data = ['Data 1' , 'Extra Column' ]
655
+ with pytest .raises (ValueError ) as excinfo :
656
+ tc .generate_data_row (row_data = row_data )
657
+ assert "Length of row_data must match length of cols" in str (excinfo .value )
658
+
659
+
638
660
def test_alternating_table_creation ():
639
661
column_1 = Column ("Col 1" , width = 15 )
640
662
column_2 = Column ("Col 2" , width = 15 )
0 commit comments