rover: use real Vector class
This commit is contained in:
parent
ca35c2bf94
commit
b90f92e557
|
@ -1,9 +1,13 @@
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from typing import Tuple
|
|
||||||
|
|
||||||
Vector = Tuple[int, int]
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class Rover():
|
class Vector:
|
||||||
|
x: int
|
||||||
|
y: int
|
||||||
|
|
||||||
|
|
||||||
|
@dataclass
|
||||||
|
class Rover:
|
||||||
pos: Vector
|
pos: Vector
|
||||||
planet_size: Vector
|
planet_size: Vector
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
from rover import *
|
from rover import Rover
|
||||||
|
|
||||||
|
|
||||||
def test_rover_constructor():
|
def test_rover_constructor():
|
||||||
rov = Rover(pos=(0, 0), planet_size=(100, 100))
|
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)
|
||||||
|
|
Loading…
Reference in a new issue