def test_zoom_for_pixelsize_valid():
    """Should work as expected (return mercator zoom)."""
    res = mercator._meters_per_pixel(12)
    assert mercator.zoom_for_pixelsize(res) == 12
    assert mercator.zoom_for_pixelsize(res, tilesize=512) == 11

    # Return max zoom
    assert mercator.zoom_for_pixelsize(0.00001) == 24
def test_m_per_pixel_valid():
    """Should work as expected (return resolution for mercator zoom)."""
    assert round(mercator._meters_per_pixel(12), 4) == 38.2185
    assert round(mercator._meters_per_pixel(12, tilesize=512), 4) == 19.1093