rover: define default values for Rover fields
This commit is contained in:
parent
b90f92e557
commit
b6d74b24eb
|
@ -9,5 +9,5 @@ class Vector:
|
|||
|
||||
@dataclass
|
||||
class Rover:
|
||||
pos: Vector
|
||||
planet_size: Vector
|
||||
pos: Vector = (0, 0)
|
||||
planet_size: Vector = (100, 100)
|
||||
|
|
|
@ -4,3 +4,8 @@ from rover import Rover
|
|||
def test_rover_constructor():
|
||||
rov = Rover(pos=(0, 0), planet_size=(100, 100))
|
||||
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)
|
||||
|
|
Loading…
Reference in a new issue