python-map-manager/tests/test_tile_manager.py
2025-12-02 09:09:22 +01:00

18 lines
735 B
Python

import unittest
from map_manager.services import OpenStreetMapService
from map_manager.tile_manager import MapTileManager
from pathlib import Path
class TestTileManagerPaths(unittest.TestCase):
def test_cache_file_path(self):
service = OpenStreetMapService()
mgr = MapTileManager(service, cache_root_directory='test_cache_dir', enable_online_tile_fetching=False, tile_pixel_size=256)
p = mgr._get_tile_cache_file_path(10, 20, 30)
# Expect path like test_cache_dir/osm/10/20/30.png
self.assertTrue(str(p).replace('\\', '/').endswith('test_cache_dir/osm/10/20/30.png') or str(p).replace('\\','/').endswith('test_cache_dir/osm/10/20/30.png'))
if __name__ == '__main__':
unittest.main()