Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions pywps/inout/storage/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ def _build_output_name(output):
if not suffix:
suffix = output.data_format.extension
_, file_name = os.path.split(prefix)

# Avoid misleading names for outputs: if the file name is the generic
# 'input' (the default used when downloading URL resources), use the
# output identifier instead so the reference URL is meaningful.
if file_name == 'input' and getattr(output, 'identifier', None):
file_name = output.identifier

output_name = file_name + suffix
return output_name, suffix

Expand Down
6 changes: 6 additions & 0 deletions tests/test_dblog.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ class DBLogTest(TestBase):
def setUp(self):
super().setUp()
self.database = configuration.get_config_value('logging', 'database')
# Ensure a clean slate: other tests may have left rows in the
# process-instance table, which would make the content assertions
# below fail when the suite runs in a different order.
session = get_session()
session.query(ProcessInstance).delete()
session.commit()

def test_0_dblog(self):
"""Test pywps.formats.Format class
Expand Down