Skip to content

Commit

Permalink
Genero la respuesta esperada de 'malformed_datetime2' 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 fde1033 commit 9c452a8
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 49 deletions.
31 changes: 30 additions & 1 deletion tests/factories/catalog_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,36 @@ def malformed_datetime():
"path": [
"issued"
],
"message": "u'2016-04-1419:48:05.433640-03:00' is not valid under any of the given schemas",
"message": "%s is not valid under any of the given schemas" % jsonschema_str('2016-04-1419:48:05.433640-03:00'),
"error_code": 2,
"validator_value": [
{
"type": "string",
"format": "date"
},
{
"type": "string",
"format": "date-time"
},
{
"type": "null"
},
{
"type": "string",
"maxLength": 0
}
]
})


def malformed_datetime2():
return catalog_error_response({
"instance": "2016-04-54T19:48:05.433640-03:00",
"validator": "anyOf",
"path": [
"issued"
],
"message": "%s is not valid under any of the given schemas" % jsonschema_str('2016-04-54T19:48:05.433640-03:00'),
"error_code": 2,
"validator_value": [
{
Expand Down
6 changes: 4 additions & 2 deletions tests/factories/core_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

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, malformed_datetime
null_catalog_publisher, empty_mandatory_string, malformed_date, malformed_datetime, \
malformed_datetime2
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 @@ -75,7 +76,7 @@
# catalog["issued"] no es una fecha y hora ISO 8601 válida
# 'malformed_datetime': None,
# catalog["issued"] no es una fecha y hora ISO 8601 válida
'malformed_datetime2': None,
# 'malformed_datetime2': None,
# dataset["temporal"] no es un rango de fechas ISO 8601 válido
'malformed_temporal': None,
# dataset["temporal"] no es un rango de fechas ISO 8601 válido
Expand Down Expand Up @@ -151,6 +152,7 @@ def missing_distribution_title():
'null_catalog_publisher': null_catalog_publisher(),
'empty_mandatory_string': empty_mandatory_string(),
'malformed_datetime': malformed_datetime(),
'malformed_datetime2': malformed_datetime2(),

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

This file was deleted.

0 comments on commit 9c452a8

Please sign in to comment.