[Git][debian-gis-team/pywps][master] 6 commits: New upstream version 4.5.2

Bas Couwenberg (@sebastic) gitlab at salsa.debian.org
Thu Apr 14 04:32:43 BST 2022



Bas Couwenberg pushed to branch master at Debian GIS Project / pywps


Commits:
65a5131e by Bas Couwenberg at 2022-04-14T05:22:54+02:00
New upstream version 4.5.2
- - - - -
c66a26f4 by Bas Couwenberg at 2022-04-14T05:22:57+02:00
Update upstream source from tag 'upstream/4.5.2'

Update to upstream version '4.5.2'
with Debian dir c407f86267c7197feb6f3a7e6afcc3b0fba2fe3d
- - - - -
6a5e5feb by Bas Couwenberg at 2022-04-14T05:23:16+02:00
New upstream release.

- - - - -
245cf595 by Bas Couwenberg at 2022-04-14T05:24:51+02:00
Update copyright file.

- - - - -
9fa470d5 by Bas Couwenberg at 2022-04-14T05:25:13+02:00
Refresh patches.

- - - - -
d37d613f by Bas Couwenberg at 2022-04-14T05:25:23+02:00
Set distribution to unstable.

- - - - -


20 changed files:

- .github/workflows/main.yml
- LICENSE.txt
- README.md
- VERSION.txt
- debian/changelog
- debian/copyright
- debian/patches/offline-tests.patch
- pywps/__init__.py
- pywps/app/WPSRequest.py
- pywps/inout/basic.py
- pywps/inout/inputs.py
- requirements-dev.txt
- setup.cfg
- setup.py
- tests/processes/__init__.py
- tests/test_exceptions.py
- tests/test_inout.py
- tests/test_processing.py
- tests/test_wpsrequest.py
- tox.ini


Changes:

=====================================
.github/workflows/main.yml
=====================================
@@ -1,41 +1,55 @@
 name: build ⚙️
 
-on: [ push, pull_request ]
+on:
+  push:
+    branches:
+      - main
+  pull_request:
 
 jobs:
-  main:
+  test:
     runs-on: ubuntu-latest
     strategy:
       matrix:
-        python-version: [3.7, 3.8, 3.9]
-    env:
-        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-        COVERALLS_SERVICE_NAME: github
+        include:
+          - tox-env: py37-extra
+            python-version: 3.7
+          - tox-env: py38-extra
+            python-version: 3.8
+          - tox-env: py39-extra
+            python-version: 3.9
     steps:
     - uses: actions/checkout at v2
-    - name: Install packages
+    - name: Install packages 📦
       run: |
-        sudo apt-get update && sudo apt-get -y install libnetcdf-dev libhdf5-dev
+        sudo apt-get update
+        sudo apt-get -y install libnetcdf-dev libhdf5-dev
     - uses: actions/setup-python at v2
       name: Setup Python ${{ matrix.python-version }}
       with:
         python-version: ${{ matrix.python-version }}
-    - name: Install requirements 📦
+    - name: Run flake8 ⚙️
       run: |
-        pip3 install pip --upgrade
-        pip3 install -r requirements.txt
-        pip3 install -r requirements-dev.txt
-        pip3 install -r requirements-extra.txt
-    - name: run tests ⚙️
-      run: pytest -v tests
-    - name: run coveralls ⚙️
-      run: coveralls
+        pip install flake8
+        flake8 pywps
       if: matrix.python-version == 3.7
-    - name: build docs 🏗️
-      run: |
-        pip3 install -e .
-        cd docs && make html
-      if: matrix.python-version == 3.7
-    - name: run flake8 ⚙️
-      run: flake8 pywps
+    - name: Install tox 📦
+      run: pip install tox
+    - name: Run tests with tox ⚙️
+      run: tox -e ${{ matrix.tox-env }}
+    - name: Run coveralls ⚙️
       if: matrix.python-version == 3.7
+      uses: AndreMiras/coveralls-python-action at develop
+
+  docs:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout at v2
+      - uses: actions/setup-python at v2
+        name: Setup Python 3.7
+        with:
+          python-version: 3.7
+      - name: Build docs 🏗️
+        run: |
+          pip install -e .[dev]
+          cd docs && make html


=====================================
LICENSE.txt
=====================================
@@ -1,4 +1,4 @@
-Copyright (C) 2014-2016 PyWPS Development Team, represented by Jachym Cepicky
+Copyright (C) 2014-2021 PyWPS Development Team, represented by Jachym Cepicky
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to


=====================================
README.md
=====================================
@@ -5,7 +5,7 @@ the Open Geospatial Consortium. PyWPS is written in Python.
 
 [![Documentation Status](https://img.shields.io/badge/docs-latest-brightgreen.svg)](https://pywps.readthedocs.io/en/latest/?badge=latest)
 [![Build Status](https://github.com/geopython/pywps/actions/workflows/main.yml/badge.svg)](https://github.com/geopython/pywps/actions/workflows/main.yml)
-[![Coverage Status](https://coveralls.io/repos/github/geopython/pywps/badge.svg?branch=master)](https://coveralls.io/github/geopython/pywps?branch=master)
+[![Coverage Status](https://coveralls.io/repos/github/geopython/pywps/badge.svg?branch=main)](https://coveralls.io/github/geopython/pywps?branch=main)
 [![PyPI](https://img.shields.io/pypi/dm/pywps.svg)](https://pypi.org/project/pywps/)
 [![GitHub license](https://img.shields.io/github/license/geopython/pywps.svg)]()
 
@@ -26,7 +26,7 @@ See [requirements.txt](requirements.txt) file
 ```bash
 pip install -r requirements-dev.txt
 # run unit tests
-python -m unittest tests
+python -m pytest tests
 # run code coverage
 python -m coverage run --source=pywps -m unittest tests
 python -m coverage report -m


=====================================
VERSION.txt
=====================================
@@ -1 +1 @@
-4.5.1
+4.5.2


=====================================
debian/changelog
=====================================
@@ -1,3 +1,12 @@
+pywps (4.5.2-1) unstable; urgency=medium
+
+  * Team upload.
+  * New upstream release.
+  * Update copyright file.
+  * Refresh patches.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Thu, 14 Apr 2022 05:25:14 +0200
+
 pywps (4.5.1-1) unstable; urgency=medium
 
   * Team upload.


=====================================
debian/copyright
=====================================
@@ -5,7 +5,7 @@ Source: https://github.com/geopython/pywps/releases
 
 Files: *
 Copyright: 2018-2019, Open Source Geospatial Foundation and others
-           2014-2016, PyWPS Development Team, represented by PyWPS Project Steering Committee
+           2014-2021, PyWPS Development Team, represented by PyWPS Project Steering Committee
 License: Expat
 
 Files: pywps/schemas/geojson/*


=====================================
debian/patches/offline-tests.patch
=====================================
@@ -62,7 +62,7 @@ Forwarded: not-needed
      def test_url(self):
          if not service_ok('https://demo.mapserver.org'):
              self.skipTest("mapserver is unreachable")
-@@ -513,6 +514,7 @@ class ComplexOutputTest(unittest.TestCas
+@@ -548,6 +549,7 @@ class ComplexOutputTest(unittest.TestCas
          b = self.complex_out.base64
          self.assertEqual(base64.b64decode(b).decode(), self.data)
  
@@ -70,7 +70,7 @@ Forwarded: not-needed
      def test_url_handler(self):
          wfsResource = 'http://demo.mapserver.org/cgi-bin/wfs?' \
                        'service=WFS&version=1.1.0&' \
-@@ -755,6 +757,7 @@ class BBoxOutputTest(unittest.TestCase):
+@@ -790,6 +792,7 @@ class BBoxOutputTest(unittest.TestCase):
          )
  
  


=====================================
pywps/__init__.py
=====================================
@@ -9,7 +9,7 @@ import os
 
 from lxml.builder import ElementMaker
 
-__version__ = "4.5.1"
+__version__ = "4.5.2"
 
 LOGGER = logging.getLogger('PYWPS')
 LOGGER.debug('setting core variables')


=====================================
pywps/app/WPSRequest.py
=====================================
@@ -575,7 +575,7 @@ def get_inputs_from_xml(doc):
                 inpt = {}
                 inpt['identifier'] = identifier_el.text
                 inpt['data'] = [bbox.minx, bbox.miny, bbox.maxx, bbox.maxy]
-                inpt['crs'] = bbox.crs
+                inpt['crs'] = bbox.crs.getcodeurn() if bbox.crs else None
                 inpt['dimensions'] = bbox.dimensions
                 the_inputs[identifier].append(inpt)
     return the_inputs


=====================================
pywps/inout/basic.py
=====================================
@@ -1010,7 +1010,7 @@ class ComplexInput(BasicIO, BasicComplex, IOHandler):
         except Exception:
             # TODO: handle os.symlink on windows
             # raise NoApplicableCode("Could not link file reference: {}".format(e))
-            LOGGER.warn("Could not link file reference")
+            LOGGER.warning("Could not link file reference")
             shutil.copy2(inpt_file, tmp_file)
 
         return tmp_file


=====================================
pywps/inout/inputs.py
=====================================
@@ -2,7 +2,7 @@
 # Copyright 2018 Open Source Geospatial Foundation and others    #
 # licensed under MIT, Please consult LICENSE.txt for details     #
 ##################################################################
-
+import base64
 import re
 from pywps import xml_util as etree
 
@@ -220,12 +220,15 @@ class ComplexInput(basic.ComplexInput):
             instance.url = json_input['href']
         elif json_input.get('data'):
             data = json_input['data']
-            # remove cdata tag if it exists (issue #553)
-            if isinstance(data, str):
-                match = CDATA_PATTERN.match(data)
-                if match:
-                    data = match.group(1)
-            instance.data = data
+            if data_format.encoding == 'base64':
+                instance.data = base64.b64decode(data)
+            else:
+                # remove cdata tag if it exists (issue #553)
+                if isinstance(data, str):
+                    match = CDATA_PATTERN.match(data)
+                    if match:
+                        data = match.group(1)
+                instance.data = data
 
         return instance
 
@@ -247,7 +250,7 @@ class ComplexInput(basic.ComplexInput):
                 else:
                     # Otherwise we assume all other formats are unsafe and need to be enclosed in a CDATA tag.
                     if isinstance(self.data, bytes):
-                        out = self.data.encode(self.data_format.encoding or 'utf-8')
+                        out = self.data.decode(self.data_format.encoding or 'utf-8')
                     else:
                         out = self.data
 


=====================================
requirements-dev.txt
=====================================
@@ -1,6 +1,7 @@
 coverage
 coveralls
 pytest
+pytest-cov
 flake8
 pylint
 Sphinx


=====================================
setup.cfg
=====================================
@@ -1,16 +1,11 @@
 [bumpversion]
-current_version = 4.5.1
+current_version = 4.5.2
 commit = False
 tag = False
 parse = (?P<major>\d+)\.(?P<minor>\d+).(?P<patch>\d+)
 serialize = 
 	{major}.{minor}.{patch}
 
-[flake8]
-ignore = F401,E402,W606
-max-line-length = 120
-exclude = tests
-
 [bumpversion:file:pywps/__init__.py]
 search = __version__ = "{current_version}"
 replace = __version__ = "{new_version}"
@@ -18,3 +13,14 @@ replace = __version__ = "{new_version}"
 [bumpversion:file:VERSION.txt]
 search = {current_version}
 replace = {new_version}
+
+[coverage:run]
+relative_files = True
+
+[flake8]
+ignore = 
+	F401
+	E402
+	W606
+max-line-length = 120
+exclude = tests


=====================================
setup.py
=====================================
@@ -12,57 +12,68 @@ except ImportError:
 
 from setuptools import find_packages
 
-with open('VERSION.txt') as ff:
+with open("VERSION.txt") as ff:
     VERSION = ff.read().strip()
 
-DESCRIPTION = ('PyWPS is an implementation of the Web Processing Service '
-               'standard from the Open Geospatial Consortium. PyWPS is '
-               'written in Python.')
+DESCRIPTION = (
+    "PyWPS is an implementation of the Web Processing Service "
+    "standard from the Open Geospatial Consortium. PyWPS is "
+    "written in Python."
+)
 
-with open('README.md') as ff:
+with open("README.md") as ff:
     LONG_DESCRIPTION = ff.read()
 
-KEYWORDS = 'PyWPS WPS OGC processing'
+KEYWORDS = "PyWPS WPS OGC processing"
 
-with open('requirements.txt') as f:
-    INSTALL_REQUIRES = f.read().splitlines()
+with open("requirements.txt") as fr:
+    INSTALL_REQUIRES = fr.read().splitlines()
+
+with open("requirements-dev.txt") as frd:
+    DEV_REQUIRES = frd.read().splitlines()
 
 CONFIG = {
-    'name': 'pywps',
-    'version': VERSION,
-    'description': DESCRIPTION,
-    'long_description': LONG_DESCRIPTION,
-    'long_description_content_type': 'text/markdown',
-    'keywords': KEYWORDS,
-    'license': 'MIT',
-    'platforms': 'all',
-    'author': 'Jachym Cepicky',
-    'author_email': 'jachym.cepicky at gmail.com',
-    'maintainer': 'Jachym Cepicky',
-    'maintainer_email': 'jachym.cepicky at gmail.com',
-    'url': 'https://pywps.org',
-    'download_url': 'https://github.com/geopython/pywps',
-    'classifiers': [
-        'Development Status :: 5 - Production/Stable',
-        'Environment :: Web Environment',
-        'Intended Audience :: Developers',
-        'Intended Audience :: Science/Research',
-        'License :: OSI Approved :: MIT License',
-        'Operating System :: OS Independent',
-        'Programming Language :: Python',
+    "name": "pywps",
+    "version": VERSION,
+    "description": DESCRIPTION,
+    "long_description": LONG_DESCRIPTION,
+    "long_description_content_type": "text/markdown",
+    "keywords": KEYWORDS,
+    "license": "MIT",
+    "platforms": "all",
+    "author": "Jachym Cepicky",
+    "author_email": "jachym.cepicky at gmail.com",
+    "maintainer": "Jachym Cepicky",
+    "maintainer_email": "jachym.cepicky at gmail.com",
+    "url": "https://pywps.org",
+    "download_url": "https://github.com/geopython/pywps",
+    "classifiers": [
+        "Development Status :: 5 - Production/Stable",
+        "Environment :: Web Environment",
+        "Intended Audience :: Developers",
+        "Intended Audience :: Science/Research",
+        "License :: OSI Approved :: MIT License",
+        "Operating System :: OS Independent",
+        "Programming Language :: Python",
         "Programming Language :: Python :: 3",
-        "Programming Language :: Python :: 3.6",
         "Programming Language :: Python :: 3.7",
-        'Topic :: Scientific/Engineering :: GIS'
+        "Programming Language :: Python :: 3.8",
+        "Programming Language :: Python :: 3.9",
+        "Topic :: Scientific/Engineering :: GIS",
     ],
-    'install_requires': INSTALL_REQUIRES,
-    'python_requires': '>=3.6, <4',
-    'packages': find_packages(exclude=["docs", "tests.*", "tests"]),
-    'include_package_data': True,
-    'scripts': [],
-    'entry_points': {
-        'console_scripts': [
-            'joblauncher=pywps.processing.job:launcher', ]},
+    "install_requires": INSTALL_REQUIRES,
+    "extras_require": dict(
+        dev=DEV_REQUIRES,
+    ),
+    "python_requires": ">=3.7,<4",
+    "packages": find_packages(exclude=["docs", "tests.*", "tests"]),
+    "include_package_data": True,
+    "scripts": [],
+    "entry_points": {
+        "console_scripts": [
+            "joblauncher=pywps.processing.job:launcher",
+        ]
+    },
 }
 
 setup(**CONFIG)


=====================================
tests/processes/__init__.py
=====================================
@@ -4,7 +4,7 @@
 ##################################################################
 
 from pywps import Process
-from pywps.inout import LiteralInput, LiteralOutput
+from pywps.inout import LiteralInput, LiteralOutput, BoundingBoxInput, BoundingBoxOutput
 from pywps.inout.literaltypes import ValuesReference
 
 
@@ -71,3 +71,31 @@ class InOut(Process):
         a_string = request.inputs['string'][0].data
         response.outputs['string'].data = "".format(a_string)
         return response
+
+
+class BBox(Process):
+    def __init__(self):
+        super(BBox, self).__init__(
+            self.bbox,
+            identifier='bbox_test',
+            title='BBox Test',
+            inputs=[
+                BoundingBoxInput(
+                    'area',
+                    'An area',
+                    abstract='Define the area of interest',
+                    crss=['epsg:4326', 'epsg:3857'],
+                    min_occurs=1,
+                    max_occurs=1
+                ),
+            ],
+            outputs=[
+                BoundingBoxOutput('extent', 'Extent', crss=['epsg:4326', 'epsg:3857'])
+            ]
+        )
+
+    @staticmethod
+    def bbox(request, response):
+        area = request.inputs['area'][0].data
+        response.outputs['extent'].data = area
+        return response


=====================================
tests/test_exceptions.py
=====================================
@@ -10,10 +10,11 @@ from pywps.tests import assert_pywps_version, client_for
 
 import re
 
-VERSION="1.0.0"
+VERSION = "1.0.0"
 WPS, OWS = get_ElementMakerForVersion(VERSION)
 xpath_ns = get_xpath_ns(VERSION)
 
+
 class ExceptionsTest(unittest.TestCase):
 
     def setUp(self):
@@ -24,7 +25,7 @@ class ExceptionsTest(unittest.TestCase):
         exception_el = resp.xpath('/ows:ExceptionReport/ows:Exception')[0]
         assert exception_el.attrib['exceptionCode'] == 'InvalidParameterValue'
         assert resp.status_code == 400
-        assert re.match('text/xml(;\s*charset=.*)?', resp.headers['Content-Type'])
+        assert re.match(r'text/xml(;\s*charset=.*)?', resp.headers['Content-Type'])
         assert_pywps_version(resp)
 
     def test_missing_parameter_value(self):
@@ -32,20 +33,21 @@ class ExceptionsTest(unittest.TestCase):
         exception_el = resp.xpath('/ows:ExceptionReport/ows:Exception')[0]
         assert exception_el.attrib['exceptionCode'] == 'MissingParameterValue'
         assert resp.status_code == 400
-        assert re.match('text/xml(;\s*charset=.*)?', resp.headers['Content-Type'])
+        assert re.match(r'text/xml(;\s*charset=.*)?', resp.headers['Content-Type'])
 
     def test_missing_request(self):
         resp = self.client.get("?service=wps")
         exception_el = resp.xpath('/ows:ExceptionReport/ows:Exception/ows:ExceptionText')[0]
         # should mention something about a request
         assert 'request' in exception_el.text
-        assert re.match('text/xml(;\s*charset=.*)?', resp.headers['Content-Type'])
+        assert re.match(r'text/xml(;\s*charset=.*)?', resp.headers['Content-Type'])
 
     def test_bad_request(self):
         resp = self.client.get("?service=wps&request=xyz")
         exception_el = resp.xpath('/ows:ExceptionReport/ows:Exception')[0]
         assert exception_el.attrib['exceptionCode'] == 'OperationNotSupported'
-        assert re.match('text/xml(;\s*charset=.*)?', resp.headers['Content-Type'])
+        assert re.match(r'text/xml(;\s*charset=.*)?', resp.headers['Content-Type'])
+
 
 def load_tests(loader=None, tests=None, pattern=None):
     if not loader:


=====================================
tests/test_inout.py
=====================================
@@ -284,6 +284,41 @@ class SerializationComplexInputTest(unittest.TestCase):
         self.assertEqual(complex2.prop, 'data')
         self.assertEqual(complex.data, complex2.data)
 
+    def test_complex_input_binary_data(self):
+        complex = self.make_complex_input()
+        complex.data = b"some data"
+        # the data is enclosed by a CDATA tag in json
+        assert complex.json['data'] == '<![CDATA[some data]]>'
+        self.assertEqual(complex.prop, 'data')
+
+    def test_complex_input_data_with_binary_data_format(self):
+        complex = inout.inputs.ComplexInput(
+            identifier="complexinput",
+            title='MyComplex',
+            abstract='My complex input',
+            keywords=['kw1', 'kw2'],
+            workdir=self.tmp_dir,
+            supported_formats=[FORMATS.ZIP],
+            metadata=[Metadata("special data")],
+            default="/some/file/path",
+            default_type=SOURCE_TYPE.FILE,
+            translations={"fr-CA": {"title": "Mon input", "abstract": "Une description"}},
+            data_format=FORMATS.ZIP
+        )
+        complex.as_reference = False
+        complex.method = "GET"
+        complex.max_size = 1000
+        complex.data = b"some data"
+        # the data is enclosed by a CDATA tag in json
+        assert complex.json['data'] == 'c29tZSBkYXRh'
+        # dump to json and load it again
+        complex2 = inout.inputs.ComplexInput.from_json(complex.json)
+
+        self.assert_complex_equals(complex, complex2)
+        self.assertEqual(complex.prop, 'data')
+        self.assertEqual(complex2.prop, 'data')
+        self.assertEqual(complex.data, complex2.data)
+
     def test_complex_input_stream(self):
         complex = self.make_complex_input()
         complex.stream = StringIO("{'name': 'test', 'input1': ']]'}")


=====================================
tests/test_processing.py
=====================================
@@ -18,7 +18,7 @@ from pywps.processing.basic import MultiProcessing
 from pywps.app import WPSRequest
 from pywps.response.execute import ExecuteResponse
 
-from .processes import Greeter, InOut
+from .processes import Greeter, InOut, BBox
 
 
 class GreeterProcessingTest(unittest.TestCase):
@@ -97,6 +97,39 @@ class InOutProcessingTest(unittest.TestCase):
         self.assertEqual(new_job.json, self.job.json)  # idempotent test
 
 
+class BBoxProcessingTest(unittest.TestCase):
+    """Processing test case with BBox input and output process"""
+
+    def setUp(self):
+        self.uuid = uuid.uuid1()
+        self.dummy_process = BBox()
+        self.dummy_process._set_uuid(self.uuid)
+        self.dummy_process.set_workdir('/tmp')
+        self.wps_request = WPSRequest()
+        self.wps_response = ExecuteResponse(self.wps_request, self.uuid,
+                                            process=self.dummy_process)
+        self.job = Job(
+            process=self.dummy_process,
+            wps_request=self.wps_request,
+            wps_response=self.wps_response)
+
+    def test_job_json(self):
+        new_job = Job.from_json(json.loads(self.job.json))
+        self.assertEqual(new_job.name, 'bbox_test')
+        self.assertEqual(new_job.uuid, str(self.uuid))
+        self.assertEqual(new_job.workdir, '/tmp')
+        self.assertEqual(len(new_job.process.inputs), 1)
+        self.assertEqual(new_job.json, self.job.json)  # idempotent test
+
+    def test_job_dump(self):
+        new_job = Job.load(self.job.dump())
+        self.assertEqual(new_job.name, 'bbox_test')
+        self.assertEqual(new_job.uuid, str(self.uuid))
+        self.assertEqual(new_job.workdir, '/tmp')
+        self.assertEqual(len(new_job.process.inputs), 1)
+        self.assertEqual(new_job.json, self.job.json)  # idempotent test
+
+
 def load_tests(loader=None, tests=None, pattern=None):
     """Load local tests
     """
@@ -104,6 +137,7 @@ def load_tests(loader=None, tests=None, pattern=None):
         loader = unittest.TestLoader()
     suite_list = [
         loader.loadTestsFromTestCase(GreeterProcessingTest),
-        loader.loadTestsFromTestCase(InOutProcessingTest)
+        loader.loadTestsFromTestCase(InOutProcessingTest),
+        loader.loadTestsFromTestCase(BBoxProcessingTest)
     ]
     return unittest.TestSuite(suite_list)


=====================================
tests/test_wpsrequest.py
=====================================
@@ -8,6 +8,7 @@ from pywps.app import WPSRequest
 import tempfile
 import datetime
 import json
+from owslib.crs import Crs
 
 from pywps.inout.literaltypes import AnyValue
 
@@ -116,6 +117,46 @@ class WPSRequestTest(unittest.TestCase):
         self.assertEqual(self.request.inputs['date'][0].data, datetime.date(2017, 4, 20), 'Data set')
         self.assertEqual(self.request.inputs['time'][0].data, datetime.time(9, 0, 0), 'Time set')
 
+    def test_json_inout_bbox(self):
+        obj = {
+            'operation': 'getcapabilities',
+            'version': '1.0.0',
+            'language': 'eng',
+            'identifier': 'arghhhh',
+            'identifiers': 'arghhhh',  # TODO: why identifierS?
+            'store_execute': True,
+            'status': True,
+            'lineage': True,
+            'inputs': {
+                'bbox': [{
+                    'identifier': 'bbox',
+                    'type': 'bbox',
+                    'bbox': '6.117602,46.176194,6.22283,46.275832',
+                    'crs': 'urn:ogc:def:crs:EPSG::4326',
+                    'crss': ['epsg:4326'],
+                    'dimensions': 2,
+                    'translations': None
+                }],
+            },
+            'outputs': {},
+            'raw': False
+        }
+
+        self.request = WPSRequest()
+        self.request.json = obj
+
+        self.assertEqual(self.request.inputs['bbox'][0].data, [6.117602, 46.176194, 6.22283, 46.275832], 'BBox data set')
+        self.assertTrue(isinstance(self.request.inputs['bbox'][0].crs, str), 'CRS is a string')
+        self.assertEqual(self.request.inputs['bbox'][0].crs, 'epsg:4326', 'CRS data correctly parsed')
+
+        # dump to json and reload
+        dump = self.request.json
+        self.request.json = json.loads(dump)
+
+        self.assertEqual(self.request.inputs['bbox'][0].data, [6.117602, 46.176194, 6.22283, 46.275832], 'BBox data set')
+        self.assertTrue(isinstance(self.request.inputs['bbox'][0].crs, str), 'CRS is a string')
+        self.assertEqual(self.request.inputs['bbox'][0].crs, 'epsg:4326', 'CRS data correctly parsed')
+
 
 def load_tests(loader=None, tests=None, pattern=None):
     if not loader:


=====================================
tox.ini
=====================================
@@ -1,23 +1,21 @@
 [tox]
-envlist=py36
+envlist = py{37,38,39}{-extra,}
+requires = pip >= 20.0
+opts = --verbose
 
 [testenv]
-
-pip_pre=True
-deps=
-    lxml
-    flask
-    owslib
-    simplejson
-    jsonschema
-    geojson
-    shapely
-    unipath
-    werkzeug
-    SQLAlchemy
-    jinja2
-
-commands=
-	# check first which version is installed "gdal-config --version"
-	pip install GDAL==2.1.0 --global-option=build_ext --global-option="-I/usr/include/gdal"
-    python -m unittest tests
+setenv =
+    PYTEST_ADDOPTS = "--color=yes"
+    PYTHONPATH = {toxinidir}
+    COV_CORE_SOURCE =
+passenv = CI GITHUB_* LD_LIBRARY_PATH
+download = True
+install_command =
+    python -m pip install --no-user {opts} {packages}
+extras = dev
+deps =
+    extra: -rrequirements-extra.txt
+commands =
+;    # magic for gathering the GDAL version within tox
+;    sh -c 'pip install GDAL=="$(gdal-config --version)" --global-option=build_ext --global-option="-I/usr/include/gdal"'
+    pytest --cov



View it on GitLab: https://salsa.debian.org/debian-gis-team/pywps/-/compare/f5a9843cd80ac73b3202ecef7809594d9f3af2b5...d37d613f1fe3aacc3b0f57f0c656385d491190f2

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/pywps/-/compare/f5a9843cd80ac73b3202ecef7809594d9f3af2b5...d37d613f1fe3aacc3b0f57f0c656385d491190f2
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20220414/23fba6ca/attachment-0001.htm>


More information about the Pkg-grass-devel mailing list