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)
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)
def test_look(): """Test look method""" e = Eye() e.look((1, 1)) assert e.direction == (1, 1)
def test_look(): e = Eye() e.look((1, 1)) assert e.direction == (1, 1)