Spaces:
Sleeping
Sleeping
| # 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() |