Skip to content
Prev Previous commit
non integer interable test case
  • Loading branch information
mercurynomercy committed Feb 28, 2016
commit 8a3349fab68d9cb6e49132b9edd501c9dbc24bbc
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 18 additions & 6 deletions lib/matplotlib/tests/test_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,10 @@ def test_auto_column():
fig = plt.figure()

#iteratble list input
ax1 = fig.add_subplot(3, 1, 1)
ax1 = fig.add_subplot(4, 1, 1)
ax1.axis('off')
tb1 = ax1.table(cellText=[['Fit Text', 2],
['Longer text than default', 1]],
['very long long text, Longer text than default', 1]],
rowLabels=["A", "B"],
colLabels=["Col1", "Col2"],
loc="center")
Expand All @@ -141,10 +141,10 @@ def test_auto_column():
tb1.auto_set_column_width([-1, 0, 1])

#iteratble tuple input
ax2 = fig.add_subplot(3, 1, 2)
ax2 = fig.add_subplot(4, 1, 2)
ax2.axis('off')
tb2 = ax2.table(cellText=[['Fit Text', 2],
['Longer text than default', 1]],
['very long long text, Longer text than default', 1]],
rowLabels=["A", "B"],
colLabels=["Col1", "Col2"],
loc="center")
Expand All @@ -153,10 +153,10 @@ def test_auto_column():
tb2.auto_set_column_width((-1, 0, 1))

#3 single inputs
ax3 = fig.add_subplot(3, 1, 3)
ax3 = fig.add_subplot(4, 1, 3)
ax3.axis('off')
tb3 = ax3.table(cellText=[['Fit Text', 2],
['Longer text than default', 1]],
['very long long text, Longer text than default', 1]],
rowLabels=["A", "B"],
colLabels=["Col1", "Col2"],
loc="center")
Expand All @@ -165,3 +165,15 @@ def test_auto_column():
tb3.auto_set_column_width(-1)
tb3.auto_set_column_width(0)
tb3.auto_set_column_width(1)

#4 non integer interable input
ax4 = fig.add_subplot(4, 1, 4)
ax4.axis('off')
tb4 = ax4.table(cellText=[['Fit Text', 2],
['very long long text, Longer text than default', 1]],
rowLabels=["A", "B"],
colLabels=["Col1", "Col2"],
loc="center")
tb4.auto_set_font_size(False)
tb4.set_fontsize(12)
tb4.auto_set_column_width("-101")