def import_wrapper(data_context,
                  container=None,
                  protocol=None,
                  files=None,
                  sources=None,
                  equipment_setup_root=None,
                  **args):

        container = data_context.getObjectWithURI(container)
        protocol_entity = data_context.getObjectWithURI(protocol)
        if protocol_entity:
            protocol = asclass("Protocol", protocol_entity)
        else:
            protocol = None

        sources = [data_context.getObjectWithURI(source) for source in sources]

        for file in files:
            import_file(file,
                        container,
                        equipment_setup_root,
                        sources,
                        protocol=protocol)

        return 0
    def setup_class(cls):

        TestBase.setup_class()

        ctx = cls.local_stack.getAuthenticatedDataStoreCoordinator().getContext()

        proj = ctx.insertProject('ABF import', 'ABF import', DateTime())

        exp = proj.insertExperiment('ABF experiment', DateTime())
        cls.device_info = {u'amplifier.mode': u'I-clamp',
                       u'amplifier.channels.0.gain': 2.5,
                       u'amplifier.channels.1.gain': 3.5}

        # TODO when we move to beta3
        #exp.setEquipmentSetupFromMap(to_map(cls.device_info))

        cls.src = ctx.insertSource("recording source", "source-id")

        abf_file = 'fixtures/example1.abf'

        logging.info("Importing file...")
        cls.epoch_group = import_file(abf_file,
                                      exp,
                                      "amplifier",
                                      [cls.src])[0] #single block

        reader = AxonIO(filename=abf_file)
        cls.block = reader.read()[0] # single block