Skip to content

Commit

Permalink
Merge branch 'master' into 96-validacion-de-titulos-en-dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
lrromero committed Feb 20, 2018
2 parents bcdcea2 + ae491f3 commit 34ff77a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions pydatajson/ckan_utils.py
Expand Up @@ -40,6 +40,7 @@ def map_dataset_to_package(dataset, catalog_id):
package['author_email'] = dataset['publisher'].get('mbox')
append_attribute_to_extra(package, dataset, 'modified')
append_attribute_to_extra(package, dataset, 'temporal')
append_attribute_to_extra(package, dataset, 'source')
append_attribute_to_extra(package, dataset, 'language', serialize=True)

spatial = dataset.get('spatial')
Expand Down Expand Up @@ -95,6 +96,7 @@ def map_distributions_to_resources(distributions, catalog_id):
resource['mimetype'] = distribution.get('mediaType')
resource['size'] = distribution.get('byteSize')
resource['accessURL'] = distribution.get('accessURL')
resource['fileName'] = distribution.get('fileName')
dist_fields = distribution.get('field')
if dist_fields:
resource['attributesDescription'] = json.dumps(dist_fields)
Expand Down
3 changes: 2 additions & 1 deletion tests/test_ckan_utils.py
Expand Up @@ -100,7 +100,8 @@ def test_resources_replicated_attributes_stay_the_same(self):
('mimetype', 'mediaType'),
('description', 'description'),
('format', 'format'),
('size', 'byteSize')]
('size', 'byteSize'),
('fileName', 'fileName')]
for fst, snd in replicated_attributes:
if distribution.get(snd):
self.assertEqual(distribution.get(snd), resource.get(fst))
Expand Down

0 comments on commit 34ff77a

Please sign in to comment.