How to use the webserver.server_stop function in webserver

To help you get started, we’ve selected a few webserver examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github OSGeo / gdal / autotest / gcore / vsioss.py View on Github external
def test_visoss_stop_webserver():

    if gdaltest.webserver_port == 0:
        pytest.skip()

    # Clearcache needed to close all connections, since the Python server
    # can only handle one connection at a time
    gdal.VSICurlClearCache()

    webserver.server_stop(gdaltest.webserver_process, gdaltest.webserver_port)
github OSGeo / gdal / autotest / gcore / vsicurl.py View on Github external
def test_vsicurl_stop_webserver():

    if gdaltest.webserver_port == 0:
        pytest.skip()

    # Clearcache needed to close all connections, since the Python server
    # can only handle one connection at a time
    gdal.VSICurlClearCache()

    webserver.server_stop(gdaltest.webserver_process, gdaltest.webserver_port)
github OSGeo / gdal / autotest / gcore / vsigs.py View on Github external
def test_vsigs_stop_webserver():

    if gdaltest.webserver_port == 0:
        pytest.skip()

    # Clearcache needed to close all connections, since the Python server
    # can only handle one connection at a time
    gdal.VSICurlClearCache()

    webserver.server_stop(gdaltest.webserver_process, gdaltest.webserver_port)
github OSGeo / gdal / autotest / gcore / vsis3.py View on Github external
def test_vsis3_stop_webserver():

    if gdaltest.webserver_port == 0:
        pytest.skip()

    # Clearcache needed to close all connections, since the Python server
    # can only handle one connection at a time
    gdal.VSICurlClearCache()

    webserver.server_stop(gdaltest.webserver_process, gdaltest.webserver_port)
github OSGeo / gdal / autotest / gdrivers / rda.py View on Github external
def test_rda_cleanup():

    if gdaltest.rda_drv is None:
        pytest.skip()

    if gdaltest.webserver_port != 0:
        webserver.server_stop(gdaltest.webserver_process, gdaltest.webserver_port)

    gdal.RmdirRecursive('/vsimem/cache_dir')
github OSGeo / gdal / autotest / ogr / ogr_gmlas.py View on Github external
# First try with remote schema download disabled
    with gdaltest.error_handler():
        ds = gdal.OpenEx('GMLAS:/vsimem/ogr_gmlas_cache.xml', open_options=[
            'CONFIG_FILE=false/vsimem/my/gmlas_cache'])
    assert ds is None and gdal.GetLastErrorMsg().find('Cannot resolve') >= 0

    # Test invalid cache directory
    with gdaltest.error_handler():
        ds = gdal.OpenEx('GMLAS:/vsimem/ogr_gmlas_cache.xml', open_options=[
            'CONFIG_FILE=/inexisting_directory/not/exist'])
    if ds is None:
        webserver.server_stop(webserver_process, webserver_port)
        pytest.fail()
    if ds.GetLayerCount() != 1:
        webserver.server_stop(webserver_process, webserver_port)
        pytest.fail(ds.GetLayerCount())

    # Will create the directory and download and cache
    ds = gdal.OpenEx('GMLAS:/vsimem/ogr_gmlas_cache.xml', open_options=[
        'CONFIG_FILE=/vsimem/my/gmlas_cache'])
    if ds is None:
        webserver.server_stop(webserver_process, webserver_port)
        pytest.fail()
    if ds.GetLayerCount() != 1:
        webserver.server_stop(webserver_process, webserver_port)
        pytest.fail(ds.GetLayerCount())

    gdal.Unlink('/vsimem/my/gmlas_cache/' + gdal.ReadDir('/vsimem/my/gmlas_cache')[0])

    # Will reuse the directory and download and cache
    ds = gdal.OpenEx('GMLAS:/vsimem/ogr_gmlas_cache.xml', open_options=[
github OSGeo / gdal / autotest / gcore / vsiaz.py View on Github external
def test_vsiaz_stop_webserver():

    if gdaltest.webserver_port == 0:
        pytest.skip()

    # Clearcache needed to close all connections, since the Python server
    # can only handle one connection at a time
    gdal.VSICurlClearCache()

    webserver.server_stop(gdaltest.webserver_process, gdaltest.webserver_port)
github OSGeo / gdal / autotest / ogr / ogr_mvt.py View on Github external
def test_ogr_mvt_http_stop():

    if gdaltest.webserver_port == 0:
        pytest.skip()

    webserver.server_stop(gdaltest.webserver_process, gdaltest.webserver_port)
github OSGeo / gdal / autotest / ogr / ogr_oapif.py View on Github external
def test_ogr_opaif_cleanup():

    if gdaltest.opaif_drv is None:
        pytest.skip()

    if gdaltest.webserver_port != 0:
        webserver.server_stop(gdaltest.webserver_process, gdaltest.webserver_port)
github OSGeo / gdal / autotest / gdrivers / daas.py View on Github external
def test_daas_cleanup():

    if gdaltest.daas_drv is None:
        pytest.skip()

    if gdaltest.webserver_port != 0:
        webserver.server_stop(gdaltest.webserver_process,
                              gdaltest.webserver_port)

    gdal.RmdirRecursive('/vsimem/cache_dir')

    for var in gdaltest.daas_vars:
        gdal.SetConfigOption(var, gdaltest.daas_vars[var])