Ejemplo n.º 1
0
class Eyes:
    def __init__(self):
        self.left_eye = Eye()
        self.right_eye = Eye()

    def display(self, x, y, direction):
        self.left_eye.look(direction)
        self.right_eye.look(direction)
        self.left_eye.display(x - 20, y)
        self.right_eye.display(x + 20, y)
Ejemplo n.º 2
0
class Eyes:
    def __init__(self):
        """Eyes constructor"""
        self.left_eye = Eye()
        self.right_eye = Eye()

    def display(self, x, y, direction):
        """Display eyes direction"""
        self.left_eye.look(direction)
        self.right_eye.look(direction)
        self.left_eye.display(x-20, y)
        self.right_eye.display(x+20, y)
Ejemplo n.º 3
0
def test_look():
    """Test look method"""
    e = Eye()
    e.look((1, 1))
    assert e.direction == (1, 1)
Ejemplo n.º 4
0
def test_look():
    e = Eye()
    e.look((1, 1))
    assert e.direction == (1, 1)