def test_get_input_title(self): """Test returning the proper input title""" # configure def donothing(*args, **kwargs): pass process = Process(donothing, "process", title="Process", inputs=[ LiteralInput("length", title="Length"), BoundingBoxInput("bbox", title="BBox", crss=[]), ComplexInput("vector", title="Vector") ], outputs=[], metadata=[ Metadata('process metadata 1', 'http://example.org/1'), Metadata('process metadata 2', 'http://example.org/2') ]) inputs = {input.identifier: input.title for input in process.inputs} self.assertEqual("Length", inputs['length']) self.assertEqual("BBox", inputs["bbox"]) self.assertEqual("Vector", inputs["vector"])
def __init__(self): super(DoNothing, self).__init__(self.donothing, "process", title="Process", abstract="Process description", inputs=[ LiteralInput("length", title="Length"), BoundingBoxInput("bbox", title="BBox", crss=[]), ComplexInput("vector", title="Vector", supported_formats=[FORMATS.GML]) ], outputs=[], metadata=[ Metadata('process metadata 1', 'http://example.org/1'), Metadata('process metadata 2', 'http://example.org/2') ], translations={ "fr-CA": { "title": "Processus", "abstract": "Une description" } })
def __init__(self): super(Greeter, self).__init__( self.greeter, identifier='greeter', title='Greeter', inputs=[LiteralInput('name', 'Input name', data_type='string')], outputs=[ LiteralOutput('message', 'Output message', data_type='string') ])
def __init__(self): super(DoNothing, self).__init__(self.donothing, "process", title="Process", inputs=[ LiteralInput("length", title="Length"), BoundingBoxInput("bbox", title="BBox", crss=[]), ComplexInput("vector", title="Vector", supported_formats=[FORMATS.GML]) ], outputs=[], metadata=[ Metadata('process metadata 1', 'http://example.org/1'), Metadata('process metadata 2', 'http://example.org/2') ])
def __init__(self): inputs = [ LiteralInput('literal_input', "Literal input title", 'integer', "Literal input value abstract.", min_occurs=0, max_occurs=1, uoms=['meters', 'feet'], default=1), LiteralInput('date_input', 'The title is shown when no abstract is provided.', 'date', allowed_values=['2000-01-01', '2018-01-01']), ComplexInput( 'complex_input', 'Complex input title', [Format('application/json'), Format('application/x-netcdf')], abstract="Complex input abstract.", ), BoundingBoxInput('bb_input', 'BoundingBox input title', [ 'EPSG:4326', ], metadata=[ Metadata('EPSG.io', 'http://epsg.io/'), ]), ] outputs = [ LiteralOutput( 'literal_output', 'Literal output title', 'boolean', 'Boolean output abstract.', ), ComplexOutput( 'complex_output', 'Complex output', [ Format('text/plain'), ], ), BoundingBoxOutput('bb_output', 'BoundingBox output title', [ 'EPSG:4326', ]) ] super(DocExampleProcess, self).__init__( self._handler, identifier='doc_example_process_identifier', title="Process title", abstract="Multiline process abstract.", version="4.0", metadata=[ Metadata('PyWPS docs', 'https://pywps.org'), Metadata( 'NumPy docstring conventions', 'https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt' ) ], inputs=inputs, outputs=outputs, )
def __init__(self): self.add_input(LiteralInput())