Skip to content

Commit 1f1960d

Browse files
committed
add tests about last commit
1 parent d2d7a92 commit 1f1960d

File tree

2 files changed

+23
-7
lines changed

2 files changed

+23
-7
lines changed

plotly/tests/test_core/test_tools/test_get_subplots.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,18 @@
88
def test_non_integer_rows():
99
fig = tls.get_subplots(rows=2.1)
1010

11+
@raises(Exception)
12+
def test_less_than_zero_rows():
13+
fig = tls.make_subplots(rows=-2)
14+
1115
@raises(Exception)
1216
def test_non_integer_columns():
1317
fig = tls.get_subplots(columns=2/3)
1418

19+
@raises(Exception)
20+
def test_less_than_zero_cols():
21+
fig = tls.make_subplots(columns=-10)
22+
1523
@raises(Exception)
1624
def test_wrong_kwarg():
1725
fig = tls.get_subplots(stuff='no gonna work')

plotly/tests/test_core/test_tools/test_make_subplots.py

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,16 @@ def test_non_integer_rows():
99
fig = tls.make_subplots(rows=2.1)
1010

1111
@raises(Exception)
12-
def test_non_integer_columns():
13-
fig = tls.make_subplots(columns=2/3)
12+
def test_less_than_zero_rows():
13+
fig = tls.make_subplots(rows=-2)
14+
15+
@raises(Exception)
16+
def test_non_integer_cols():
17+
fig = tls.make_subplots(cols=2/3)
18+
19+
@raises(Exception)
20+
def test_less_than_zero_cols():
21+
fig = tls.make_subplots(cols=-10)
1422

1523
@raises(Exception)
1624
def test_wrong_kwarg():
@@ -21,16 +29,16 @@ def test_non_integer_rows():
2129
fig = tls.make_subplots(rows=2.1)
2230

2331
@raises(Exception)
24-
def test_non_integer_columns():
25-
fig = tls.make_subplots(columns=2/3)
32+
def test_non_integer_cols():
33+
fig = tls.make_subplots(cols=2/3)
2634

2735
@raises(Exception)
2836
def test_wrong_kwarg():
2937
fig = tls.make_subplots(stuff='no gonna work')
3038

3139
@raises(Exception)
3240
def test_start_cell_wrong_values():
33-
fig = tls.make_subplots(rows=2, columns=2, start_cell='not gonna work')
41+
fig = tls.make_subplots(rows=2, cols=2, start_cell='not gonna work')
3442

3543
@raises(Exception)
3644
def test_specs_wrong_type():
@@ -51,12 +59,12 @@ def test_specs_wrong_item_key():
5159
@raises(Exception)
5260
def test_specs_underspecified():
5361
fig = tls.make_subplots(rows=2, specs=[{}])
54-
fig = tls.make_subplots(rows=2, columns=2, specs=[[{}, {}], [{}]])
62+
fig = tls.make_subplots(rows=2, cols=2, specs=[[{}, {}], [{}]])
5563

5664
@raises(Exception)
5765
def test_specs_overspecified():
5866
fig = tls.make_subplots(rows=2, specs=[[{}], [{}], [{}]])
59-
fig = tls.make_subplots(columns=2, specs=[{}, {}, {}])
67+
fig = tls.make_subplots(cols=2, specs=[{}, {}, {}])
6068

6169
@raises(Exception)
6270
def test_specs_colspan_too_big():

0 commit comments

Comments
 (0)