예제 #1
0
    def test_simple_functions(self):
        turtle.forward(50)
        turtle.left(90)

        tortuga.forward(50)
        tortuga.left(90)
        self.assert_same()
예제 #2
0
    def test_same_function_names_work(self):
        # draw some things using the english commands in tortuga
        tortuga.forward(50)
        tortuga.left(90)
        tortuga.forward(50)
        tortuga.right(45)
        tortuga.backward(50)
        tortuga.left(45)
        tortuga.pensize(5)
        for c in (english_colors):
            tortuga.color(c)
            tortuga.forward(10)

        # now draw the same things using turtle
        turtle.forward(50)
        turtle.left(90)
        turtle.forward(50)
        turtle.right(45)
        turtle.backward(50)
        turtle.left(45)
        turtle.pensize(5)
        for c in (english_colors):
            turtle.color(c)
            turtle.forward(10)

        # and make sure they both resulted in the same output
        self.assert_same()
예제 #3
0
    def test_same_function_names_work(self):
        # draw some things using the english commands in tortuga
        tortuga.forward(50)
        tortuga.left(90)
        tortuga.forward(50)
        tortuga.right(45)
        tortuga.backward(50)
        tortuga.left(45)
        tortuga.pensize(5)
        for c in (english_colors):
            tortuga.color(c)
            tortuga.forward(10)

        # now draw the same things using turtle
        turtle.forward(50)
        turtle.left(90)
        turtle.forward(50)
        turtle.right(45)
        turtle.backward(50)
        turtle.left(45)
        turtle.pensize(5)
        for c in (english_colors):
            turtle.color(c)
            turtle.forward(10)

        # and make sure they both resulted in the same output
        self.assert_same()
예제 #4
0
    def test_simple_functions(self):
        turtle.forward(50)
        turtle.left(90)

        tortuga.forward(50)
        tortuga.left(90)
        self.assert_same()
예제 #5
0
파일: guiTest.py 프로젝트: cccczl/tortuga
# This is not a unit test. Instead, it is a general test to make sure the Spanish-named function calls produce an identical drawing.
# This needs to be automated and have more coverage.

import sys
import os

sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
import tortuga

tortuga.forward(50)
tortuga.left(90)
tortuga.forward(50)
tortuga.right(45)
tortuga.backward(50)
tortuga.left(45)
tortuga.pensize(5)
for c in ('blue brown orange gray green purple pink yellow white black red'.split()):
    tortuga.color(c)
    tortuga.forward(10)

t = tortuga.Tortuga()
t.subir_lapiz()
t.ir_a(-100, 0)
t.bajar_lapiz()
t.adelante(50)
t.izquierda(90)
t.adelante(50)
t.derecho(45)
t.atras(50)
t.izquierda(45)
t.tamano_lapiz(5)