rover: initial class definition
This commit is contained in:
parent
aec0c6c3fc
commit
ca35c2bf94
9
rover/rover.py
Normal file
9
rover/rover.py
Normal 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
5
rover/test_rover.py
Normal 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))
|
Loading…
Reference in a new issue