import unittest
from geodata_pipeline.config import Config, LakeConfig, RiverErosionConfig

class TestConfigLakes(unittest.TestCase):
    def test_default_lake_config(self):
        cfg = Config.default()
        self.assertIsInstance(cfg.river_erosion.lakes, LakeConfig)
        self.assertTrue(cfg.river_erosion.lakes.enabled)
        self.assertEqual(cfg.river_erosion.lakes.default_depth_m, 5.0)
        self.assertEqual(cfg.river_erosion.lakes.match_tolerance_m, 100.0)

    def test_load_lake_config(self):
        data = {
            "river_erosion": {
                "lakes": {
                    "enabled": False,
                    "default_depth_m": 10.0,
                    "match_tolerance_m": 50.0
                }
            }
        }
        cfg = Config.from_dict(data)
        self.assertFalse(cfg.river_erosion.lakes.enabled)
        self.assertEqual(cfg.river_erosion.lakes.default_depth_m, 10.0)
        self.assertEqual(cfg.river_erosion.lakes.match_tolerance_m, 50.0)

    def test_raw_config_hydrolakes(self):
        cfg = Config.default()
        self.assertEqual(cfg.raw.hydrolakes_dir, "raw/hydrolakes/HydroLAKES_polys_v10_shp")

if __name__ == "__main__":
    unittest.main()
