Spaces:
Sleeping
Sleeping
File size: 796 Bytes
ed14f5d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # tests/test_solver.py
import unittest
import numpy as np
from ortools.constraint_solver import pywrapcp
class TestGhostFleetSolver(unittest.TestCase):
def test_solver_initialization(self):
"""Test if OR-Tools manager initializes correctly."""
num_locs = 10
num_vehicles = 2
manager = pywrapcp.RoutingIndexManager(num_locs, num_vehicles, 0)
self.assertIsNotNone(manager, "Routing Manager should not be None")
def test_coordinate_generation(self):
"""Test if we generate the correct shape of data."""
# Simple mock of the generation logic
locations = np.random.rand(5, 2)
self.assertEqual(locations.shape, (5, 2), "Should define (Lat, Lon) for 5 points")
if __name__ == '__main__':
unittest.main() |