def test_processor_string(self, Record): """Processor - try import string.""" from invenio_records.manage import create self.app.config['RECORD_PROCESSORS'] = { 'marcxml': 'invenio_records.manage:convert_marcxml' } create(open(os.path.join(os.path.dirname(__file__), "data/sample-records.xml")), input_type="marcxml") self.assertEquals(Record.create.call_count, 2)
def test_processor_callable(self, Record): """Processor - try import callable.""" from invenio_records.manage import create from invenio_records.manage import convert_marcxml self.app.config['RECORD_PROCESSORS'] = {'marcxml': convert_marcxml} create(open( os.path.join(os.path.dirname(__file__), "data/sample-records.xml")), input_type="marcxml") self.assertEquals(Record.create.call_count, 2)
def test_processor_callable(self, create_record): """Processor - try import callable.""" from invenio_records.manage import create from invenio_records.manage import convert_marcxml self.app.config['RECORD_PROCESSORS'] = { 'marcxml': convert_marcxml } create(open(os.path.join(os.path.dirname(__file__), "data/sample-records.xml")), input_type="marcxml") self.assertEquals(create_record.s.call_count, 2)
def test_processor_string(self, create_record): """Processor - try import string.""" from invenio_records.manage import create self.app.config['RECORD_PROCESSORS'] = { 'marcxml': 'invenio_records.manage:convert_marcxml' } create(open( os.path.join(os.path.dirname(__file__), "data/sample-records.xml")), input_type="marcxml") self.assertEquals(create_record.s.call_count, 2)