From 325cd05e1b17fe23e4933d6c86a99b64bb14e95c Mon Sep 17 00:00:00 2001 From: Tom Kralidis Date: Sun, 29 Apr 2018 08:20:59 -0400 Subject: [PATCH] fix travis and ES (#37) --- .travis.yml | 10 +++++++--- pygeoapi/openapi.py | 2 +- tests/load_es_data.py | 1 - 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 38e009f..d873f6b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,9 @@ dist: xenial python: - "3.5" +services: + = elasticsearch + before_install: - sudo apt-get -qq update - sudo apt-get install -y libsqlite3-mod-spatialite pandoc devscripts @@ -17,11 +20,12 @@ install: env: - PYGEOAPI_CONFIG=pygeoapi-config.yml -#before_script: -# - pygeoapi generate_openapi_document -c pygeoapi-config.yml > pygeoapi-openapi.yml +before_script: + - sleep 10 + - python tests/load_es_data.py tests/data/ne_110m_populated_places_simple.geojson + - pygeoapi generate_openapi_document -c pygeoapi-config.yml > pygeoapi-openapi.yml script: - - pygeoapi generate_openapi_document -c pygeoapi-config.yml > pygeoapi-openapi.yml - pytest --cov=pygeoapi - find . -type f -name "*.py" | xargs flake8 - python setup.py --long-description | rst2html5.py diff --git a/pygeoapi/openapi.py b/pygeoapi/openapi.py index 311ac7b..317a961 100644 --- a/pygeoapi/openapi.py +++ b/pygeoapi/openapi.py @@ -199,7 +199,7 @@ def get_oas_30(cfg): for k2, v2 in p.fields.items(): path_ = '{}/items'.format(collection_name_path) - paths['{}/items'.format(path_)]['get']['parameters'].append({ + paths['{}'.format(path_)]['get']['parameters'].append({ 'name': k2, 'in': 'query', 'required': False, diff --git a/tests/load_es_data.py b/tests/load_es_data.py index d7cedab..d8687f0 100644 --- a/tests/load_es_data.py +++ b/tests/load_es_data.py @@ -34,7 +34,6 @@ import sys from elasticsearch import Elasticsearch es = Elasticsearch() -index_name = 'ne_110m_populated_places_simple' type_name = 'FeatureCollection' if (sys.argv) == 1: