rover: use real Vector class

This commit is contained in:
Bruno BELANYI 2019-11-15 20:34:34 +01:00
parent ca35c2bf94
commit b90f92e557
2 changed files with 10 additions and 5 deletions

View file

@ -1,9 +1,13 @@
from dataclasses import dataclass
from typing import Tuple
Vector = Tuple[int, int]
@dataclass
class Rover():
class Vector:
x: int
y: int
@dataclass
class Rover:
pos: Vector
planet_size: Vector

View file

@ -1,5 +1,6 @@
from rover import *
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))
assert rov.pos == (0, 0) and rov.planet_size == (100, 100)