From ca35c2bf94879a44ab0d70479b9fe3941ff938cb Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Fri, 15 Nov 2019 20:29:06 +0100 Subject: [PATCH] rover: initial class definition --- rover/rover.py | 9 +++++++++ rover/test_rover.py | 5 +++++ 2 files changed, 14 insertions(+) create mode 100644 rover/rover.py create mode 100644 rover/test_rover.py diff --git a/rover/rover.py b/rover/rover.py new file mode 100644 index 0000000..9d11a8d --- /dev/null +++ b/rover/rover.py @@ -0,0 +1,9 @@ +from dataclasses import dataclass +from typing import Tuple + +Vector = Tuple[int, int] + +@dataclass +class Rover(): + pos: Vector + planet_size: Vector diff --git a/rover/test_rover.py b/rover/test_rover.py new file mode 100644 index 0000000..87fb1cc --- /dev/null +++ b/rover/test_rover.py @@ -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))