Skip to content

Commit f1c4d6d

Browse files
committed
Add some tests
1 parent 3b1ffc9 commit f1c4d6d

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

test_chaos_game.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import chaos_game as cg
2+
import pytest as pt
3+
4+
5+
def test_chaos_constructor():
6+
g = cg.ChaosGame(1)
7+
assert g._n == 3
8+
9+
def test_show_exception():
10+
with pt.raises(Exception):
11+
g = cg.ChaosGame()
12+
g.show(True)
13+
14+
def test_savepng_exception():
15+
with pt.raises(Exception):
16+
g = cg.ChaosGame()
17+
g.savepng("bigmanting")
18+
19+
def test_plot_exception():
20+
with pt.raises(Exception):
21+
g = cg.ChaosGame()
22+
g.plot("bigmanting")
23+

0 commit comments

Comments
 (0)