Skip to content
This repository has been archived by the owner on May 10, 2023. It is now read-only.

Commit

Permalink
* Improved tests. #41
Browse files Browse the repository at this point in the history
  • Loading branch information
garciparedes committed Sep 1, 2019
1 parent fd693d6 commit 341c53d
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/test_models/test_plannings.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from typing import TYPE_CHECKING

import itertools as it
from uuid import UUID

import jinete as jit

Expand Down Expand Up @@ -36,11 +37,33 @@ def test_construction(self):
planning = jit.Planning(self.routes)

self.assertIsInstance(planning, jit.Planning)
self.assertIsNotNone(planning.uuid)
self.assertIsInstance(planning.uuid, UUID)
self.assertIsNotNone(planning.routes)
self.assertIsInstance(planning.routes, set)

self.assertTrue(all(isinstance(route, jit.Route) for route in planning.routes))
self.assertEqual(planning.routes, self.routes)

def test_loaded_routes(self):
planning = jit.Planning(self.routes)
self.assertEqual(planning.loaded_routes, self.loaded_routes)

def test_planned_trips(self):
planning = jit.Planning(self.routes)
self.assertEqual(list(planning.planned_trips), self.planned_trips)

def test_trips(self):
planning = jit.Planning(self.routes)
self.assertEqual(list(planning.trips), self.trips)

def test_as_dict(self):
planning = jit.Planning(self.routes)
expected = {
'uuid': planning.uuid,
}
self.assertEqual(expected, planning.as_dict())

def test_deepcopy(self):
planning = jit.Planning(self.routes)

Expand Down

0 comments on commit 341c53d

Please sign in to comment.