From b927e8d79610ddc476d22a4db0f5d85706a49253 Mon Sep 17 00:00:00 2001 From: Pingu Carsti Date: Fri, 12 Apr 2024 17:43:33 +0200 Subject: [PATCH] remove hello process --- parrot/processes/__init__.py | 2 -- parrot/processes/wps_say_hello.py | 47 ------------------------------- tests/test_wps_caps.py | 1 - tests/test_wps_hello.py | 15 ---------- 4 files changed, 65 deletions(-) delete mode 100644 parrot/processes/wps_say_hello.py delete mode 100644 tests/test_wps_hello.py diff --git a/parrot/processes/__init__.py b/parrot/processes/__init__.py index 7a2dd77..ce30a3d 100644 --- a/parrot/processes/__init__.py +++ b/parrot/processes/__init__.py @@ -1,7 +1,5 @@ -from .wps_say_hello import SayHello from .wps_dashboard import Dashboard processes = [ - SayHello(), Dashboard(), ] diff --git a/parrot/processes/wps_say_hello.py b/parrot/processes/wps_say_hello.py deleted file mode 100644 index 2d67782..0000000 --- a/parrot/processes/wps_say_hello.py +++ /dev/null @@ -1,47 +0,0 @@ -from pywps import Process, LiteralInput, LiteralOutput, UOM -from pywps.app.Common import Metadata - -import logging -LOGGER = logging.getLogger("PYWPS") - - -class SayHello(Process): - """A nice process saying 'hello'.""" - def __init__(self): - inputs = [ - LiteralInput('name', 'Your name', - abstract='Please enter your name.', - keywords=['name', 'firstname'], - data_type='string')] - outputs = [ - LiteralOutput('output', 'Output response', - abstract='A friendly Hello from us.', - keywords=['output', 'result', 'response'], - data_type='string')] - - super(SayHello, self).__init__( - self._handler, - identifier='hello', - title='Say Hello', - abstract='Just says a friendly Hello.' - 'Returns a literal string output with Hello plus the inputed name.', - keywords=['hello', 'demo'], - metadata=[ - Metadata('PyWPS', 'https://pywps.org/'), - Metadata('Birdhouse', 'http://bird-house.github.io/'), - Metadata('PyWPS Demo', 'https://pywps-demo.readthedocs.io/en/latest/'), - Metadata('Emu: PyWPS examples', 'https://emu.readthedocs.io/en/latest/'), - ], - version='1.5', - inputs=inputs, - outputs=outputs, - store_supported=True, - status_supported=True - ) - - @staticmethod - def _handler(request, response): - LOGGER.info("say hello") - response.outputs['output'].data = 'Hello ' + request.inputs['name'][0].data - response.outputs['output'].uom = UOM('unity') - return response diff --git a/tests/test_wps_caps.py b/tests/test_wps_caps.py index e5fdac7..c8b8fbd 100644 --- a/tests/test_wps_caps.py +++ b/tests/test_wps_caps.py @@ -12,5 +12,4 @@ def test_wps_caps(): ) assert sorted(names.split()) == [ "dashboard", - "hello", ] diff --git a/tests/test_wps_hello.py b/tests/test_wps_hello.py deleted file mode 100644 index 53e7836..0000000 --- a/tests/test_wps_hello.py +++ /dev/null @@ -1,15 +0,0 @@ -from pywps import Service -from pywps.tests import client_for, assert_response_success - -from .common import get_output -from parrot.processes.wps_say_hello import SayHello - - -def test_wps_hello(): - client = client_for(Service(processes=[SayHello()])) - datainputs = "name=LovelySugarBird" - resp = client.get( - "?service=WPS&request=Execute&version=1.0.0&identifier=hello&datainputs={}".format( - datainputs)) - assert_response_success(resp) - assert get_output(resp.xml) == {'output': "Hello LovelySugarBird"}