rover: initial class definition

This commit is contained in:
Bruno BELANYI 2019-11-15 20:29:06 +01:00
parent aec0c6c3fc
commit ca35c2bf94
2 changed files with 14 additions and 0 deletions

9
rover/rover.py Normal file
View file

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

5
rover/test_rover.py Normal file
View file

@ -0,0 +1,5 @@
from rover import *
def test_rover_constructor():
rov = Rover(pos=(0, 0), planet_size=(100, 100))
assert(rov.pos == (0, 0) and rov.planet_size == (100, 100))