def performMapping(self, domainId, mappingId, urlString): mapping = self._proxy.getMappingObject(mappingId) mapping.addObserver(StreamEventLogger(self._output)) self._output.write(mapping.mappingInfo()) self._output.write('\n') response = OaiRequest(urlString).request() for record in response.records: response.selectRecord(record) try: upload = mapping.createUpload(TestRepository, response, doAsserts=True) self.writeUpload(upload) except DataMapAssertionException, ex: self.writeLine('AssertionError: '+str(ex))
def performMapping(self, mappingData, urlString, mappingObject=None): if mappingObject: mapping = mappingObject else: mapping = Mapping(mappingData.get('identifier')) mapping.fill(None, mappingData) mapping.addObserver(StreamEventLogger(self._output)) self._output.write(mapping.mappingInfo()) self._output.write('\n') response = OaiRequest(urlString).request() for record in response.records: response.selectRecord(record) try: upload = mapping.createUpload(TestRepository, response, doAsserts=True) self.writeUpload(upload) except DataMapAssertionException, ex: self.writeLine('AssertionError: '+str(ex))
def performMapping(self, mappingData, urlString, mappingObject=None): if mappingObject: mapping = mappingObject else: mapping = Mapping(mappingData.get('identifier')) mapping.fill(None, mappingData) mapping.addObserver(StreamEventLogger(self._output)) self._output.write(mapping.mappingInfo() or '') self._output.write('\n') response = OaiRequest(urlString).request() for record in response.records: response.selectRecord(record) try: upload = mapping.createUpload(TestRepository, response, doAsserts=True) self.writeUpload(upload) except DataMapAssertionException as ex: self.writeLine('AssertionError: ' + str(ex))