kata/rover/test_rover.py

22 lines
510 B
Python
Raw Normal View History

2019-11-15 20:43:59 +01:00
from rover import Direction, Rover
2019-11-15 20:34:34 +01:00
2019-11-15 20:29:06 +01:00
def test_rover_constructor():
rov = Rover(pos=(0, 0), planet_size=(100, 100))
2019-11-15 20:34:34 +01:00
assert rov.pos == (0, 0) and rov.planet_size == (100, 100)
def test_rover_default_values():
rov = Rover()
assert rov.pos == (0, 0) and rov.planet_size == (100, 100)
2019-11-15 20:43:59 +01:00
def test_rover_has_direction():
rov = Rover(dir=Direction.NORTH)
assert rov.dir == Direction.NORTH
def test_rover_default_direction_is_north():
rov = Rover()
assert rov.dir == Direction.NORTH