# Path: mapchete/cli/main.py
# @with_plugins(commands)
# @click.version_option(version=__version__, message="%(version)s")
# @click.group()
# def main():
#     pass
# 
# Path: mapchete/cli/options.py
# MULTIPROCESSING_START_METHODS = get_all_start_methods()
# def _validate_zoom(ctx, param, zoom):
# def _validate_bounds(ctx, param, bounds):
# def _validate_crs(ctx, param, crs):
# def _validate_mapchete_files(ctx, param, mapchete_files):
# def _set_debug_log_level(ctx, param, debug):
# def _setup_logfile(ctx, param, logfile):
# def _cb_key_val(ctx, param, value):
# def _cb_none_concurrency(ctx, param, value):
# 
# Path: mapchete/errors.py
# class MapcheteProcessOutputError(ValueError):
#     """Raised when a mapchete process output is invalid."""


from click.testing import CliRunner
from shapely import wkt
from shapely.geometry import shape
from rasterio.io import MemoryFile
from rio_cogeo.cogeo import cog_validate
from mapchete.cli.main import main as mapchete_cli
from mapchete.cli import options
from mapchete.errors import MapcheteProcessOutputError
import fiona
import geobuf
import os
import pytest
import shapely.geos
import rasterio
import warnings
import yaml
import mapchete
"""Test Mapchete main module and processing."""




SCRIPTDIR = os.path.dirname(os.path.realpath(__file__))
TESTDATA_DIR = os.path.join(SCRIPTDIR, "testdata")


def version_is_greater_equal(a, b):
    a_major, a_minor, a_patch = a
    b_major, b_minor, b_patch = b
    if a_major > b_major:
        return True
    elif a_major == b_major:
        if a_minor > b_minor:
            return True
        elif a_minor == b_minor:
            return a_patch >= b_patch
        else:
            return False
    else:
        return False


def run_cli(args, expected_exit_code=0, output_contains=None, raise_exc=True):
    result = CliRunner(env=dict(MAPCHETE_TEST="TRUE"), mix_stderr=True).invoke(

# Path: mapchete/cli/main.py
# @with_plugins(commands)
# @click.version_option(version=__version__, message="%(version)s")
# @click.group()
# def main():
#     pass
# 
# Path: mapchete/cli/options.py
# MULTIPROCESSING_START_METHODS = get_all_start_methods()
# def _validate_zoom(ctx, param, zoom):
# def _validate_bounds(ctx, param, bounds):
# def _validate_crs(ctx, param, crs):
# def _validate_mapchete_files(ctx, param, mapchete_files):
# def _set_debug_log_level(ctx, param, debug):
# def _setup_logfile(ctx, param, logfile):
# def _cb_key_val(ctx, param, value):
# def _cb_none_concurrency(ctx, param, value):
# 
# Path: mapchete/errors.py
# class MapcheteProcessOutputError(ValueError):
#     """Raised when a mapchete process output is invalid."""


# Path: test/test_cli.py
from click.testing import CliRunner
from shapely import wkt
from shapely.geometry import shape
from rasterio.io import MemoryFile
from rio_cogeo.cogeo import cog_validate
from mapchete.cli.main import main as mapchete_cli
from mapchete.cli import options
from mapchete.errors import MapcheteProcessOutputError
import fiona
import geobuf
import os
import pytest
import shapely.geos
import rasterio
import warnings
import yaml
import mapchete

"""Test Mapchete main module and processing."""




SCRIPTDIR = os.path.dirname(os.path.realpath(__file__))
TESTDATA_DIR = os.path.join(SCRIPTDIR, "testdata")


def version_is_greater_equal(a, b):
    a_major, a_minor, a_patch = a
    b_major, b_minor, b_patch = b
    if a_major > b_major:
        return True
    elif a_major == b_major:
        if a_minor > b_minor:
            return True
        elif a_minor == b_minor:
            return a_patch >= b_patch
        else:
            return False
    else:
        return False


def run_cli(args, expected_exit_code=0, output_contains=None, raise_exc=True):
    result = CliRunner(env=dict(MAPCHETE_TEST="TRUE"), mix_stderr=True).invoke(

        mapchete_cli, args