Skip to content

Commit

Permalink
Genero la respuesta esperada de 'malformed_datetime' mediante python
Browse files Browse the repository at this point in the history
refs:#87
  • Loading branch information
leandro-gomez committed Dec 20, 2017
1 parent 936a167 commit fde1033
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 48 deletions.
29 changes: 29 additions & 0 deletions tests/factories/catalog_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,32 @@ def malformed_date():
}
]
})


def malformed_datetime():
return catalog_error_response({
"instance": "2016-04-1419:48:05.433640-03:00",
"validator": "anyOf",
"path": [
"issued"
],
"message": "u'2016-04-1419:48:05.433640-03:00' is not valid under any of the given schemas",
"error_code": 2,
"validator_value": [
{
"type": "string",
"format": "date"
},
{
"type": "string",
"format": "date-time"
},
{
"type": "null"
},
{
"type": "string",
"maxLength": 0
}
]
})
5 changes: 3 additions & 2 deletions tests/factories/core_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from tests.factories.catalog_errors import missing_catalog_title, missing_catalog_description, \
missing_catalog_dataset, invalid_catalog_publisher_type, invalid_publisher_mbox_format, \
null_catalog_publisher, empty_mandatory_string, malformed_date
null_catalog_publisher, empty_mandatory_string, malformed_date, malformed_datetime
from tests.factories.dataset_errors import missing_dataset_title, missing_dataset_description, \
malformed_accrualperiodicity
from tests.factories.other_errors import multiple_missing_descriptions, invalid_multiple_fields_type
Expand Down Expand Up @@ -73,7 +73,7 @@
# catalog["issued"] no es una fecha ISO 8601 válida
# 'malformed_date': None,
# catalog["issued"] no es una fecha y hora ISO 8601 válida
'malformed_datetime': None,
# 'malformed_datetime': None,
# catalog["issued"] no es una fecha y hora ISO 8601 válida
'malformed_datetime2': None,
# dataset["temporal"] no es un rango de fechas ISO 8601 válido
Expand Down Expand Up @@ -150,6 +150,7 @@ def missing_distribution_title():
'missing_catalog_dataset': missing_catalog_dataset(),
'null_catalog_publisher': null_catalog_publisher(),
'empty_mandatory_string': empty_mandatory_string(),
'malformed_datetime': malformed_datetime(),

'missing_dataset_title': missing_dataset_title(),
'missing_dataset_description': missing_dataset_description(),
Expand Down
46 changes: 0 additions & 46 deletions tests/results/malformed_datetime.json

This file was deleted.

0 comments on commit fde1033

Please sign in to comment.