forked from silshack/fall2013turtlehack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
68 lines (48 loc) · 1.21 KB
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import turtle
import turtlehack
test_turtle = turtle.Turtle()
# Reset function for in between tests
def reset(turtle):
turtle.color('black')
turtle.setpos(0,0)
# random_color() test
try:
print "Testing random_color()"
test_turtle.color(turtlehack.random_color())
test_turtle.circle(5)
except:
print "-- problem with random_color()"
reset(test_turtle)
# colored_circle() test
try:
print "Testing colored_circle()"
turtlehack.colored_circle(test_turtle, 10, 'red')
except:
print "-- problem with colored_circle()"
reset(test_turtle)
# colored_square() test
try:
print "Testing colored_square()"
turtlehack.colored_square(test_turtle, 20, 'blue')
except:
print "-- problem with colored_square"
reset(test_turtle)
# random_circle() test
try:
print "Testing random_circle()"
test_turtle.color('green')
turtlehack.random_circle(test_turtle, 5, 25)
except:
print "-- problem with random_circle()"
reset(test_turtle)
# random_location() test
try:
print "Testing random_location()"
test_turtle.color('purple')
turtlehack.random_location(test_turtle, 50, 50)
except:
print "-- problem with random_location()"
####################
print "End of tests"
reset(test_turtle)
turtle.done()