"""Tests para add_basemap_osm."""

import sys
from pathlib import Path

import matplotlib
matplotlib.use("Agg")

sys.path.insert(0, str(Path(__file__).parent.parent.parent))

from geo.add_basemap_osm import add_basemap_osm


def test_no_lanza_excepcion_con_Axes_valido():
    import matplotlib.pyplot as plt

    fig, ax = plt.subplots()
    ax.set_xlim(-430000, -350000)
    ax.set_ylim(4500000, 4600000)
    # Must not raise regardless of network availability
    add_basemap_osm(ax, zoom=5)
    plt.close(fig)
