Merge branch 'master' into release-v2.0

This commit is contained in:
amercader 2014-06-07 19:41:04 +01:00
commit db3e418dc6
3 changed files with 11 additions and 5 deletions

View File

@ -81,6 +81,14 @@ class GeminiHarvester(SpatialHarvester):
raise
def import_gemini_object(self, gemini_string):
'''Imports the Gemini metadata into CKAN.
The harvest_source_reference is an ID that the harvest_source uses
for the metadata document. It is the same ID the Coupled Resources
use to link dataset and service records.
Some errors raise Exceptions.
'''
log = logging.getLogger(__name__ + '.import')
xml = etree.fromstring(gemini_string)
valid, profile, errors = self._get_validator().is_valid(xml)
@ -91,7 +99,8 @@ class GeminiHarvester(SpatialHarvester):
unicode_gemini_string = etree.tostring(xml, encoding=unicode, pretty_print=True)
package = self.write_package_from_gemini_string(unicode_gemini_string)
# may raise Exception for errors
package_dict = self.write_package_from_gemini_string(unicode_gemini_string)
def write_package_from_gemini_string(self, content):
@ -367,7 +376,6 @@ class GeminiHarvester(SpatialHarvester):
parties = {}
owners = []
publishers = []
from nose.tools import set_trace; set_trace()
for responsible_party in responsible_organisations:
if responsible_party['role'] == 'owner':
owners.append(responsible_party['organisation-name'])

View File

@ -104,7 +104,6 @@ class TestBboxQueryPerformance(SpatialQueryTestBase):
# x values for the fixtures
fixtures_x = [(random.uniform(0, 3), random.uniform(3,9)) \
for x in xrange(10)] # increase the number to 1000 say
def test_query(self):
bbox_dict = self.x_values_to_bbox((2, 7))
t0 = time.time()

View File

@ -15,8 +15,7 @@ port = 5000
use = config:../ckan/test-core.ini
# Here we hard-code the database and a flag to make default tests
# run fast.
sqlalchemy.url = postgresql://ckantest:pass@localhost/ckantest
ckan.plugins = harvest spatial_metadata spatial_query spatial_query_widget wms_preview spatial_harvest_metadata_api synchronous_search gemini_csw_harvester gemini_doc_harvester gemini_waf_harvester cswserver
ckan.plugins = harvest spatial_metadata spatial_query spatial_query_widget dataset_extent_map wms_preview spatial_harvest_metadata_api synchronous_search gemini_csw_harvester gemini_doc_harvester gemini_waf_harvester cswserver
ckan.spatial.srid = 4326
ckan.spatial.default_map_extent=-6.88,49.74,0.50,59.2
ckan.spatial.testing = true