def __init__(self, test_name, config):

        self.test_name = test_name
        self.result = ''
        self.error_message = None

        try:
            self.test_dir = self.create_dir('.', test_name)

            self.scenes_dir = self.create_dir(self.test_dir, 'scenes')
            self.remove_old_links()
            if config.has_option(test_name, 'scenes'):
                scene_list = self.link_scenes(test_name, config)
            else:
                scene_list = None

            # export the list of scenes as environment variables for use by
            # called shell script
            for iscene in range(len(scene_list)):
                os.environ[iscene %'SCENE_DIR%d'] = scene_list[iscene]
            os.environ['Nscenes'] = str(len(scene_list))

            os.environ['SYSTEST_DIR'] = self.test_dir

            self.temp_dir = self.create_dir(self.test_dir, 'temp')
            self.tile_dir = self.create_dir(self.test_dir, 'tiles')


            self.dbname = dbutil.random_name(test_name)
            self.load_initial_database(test_name, config)
            self.make_datacube_config(test_name, config)

            self.command = None
            if config.has_option(test_name, 'command'):
                self.command = config.get(test_name, 'command')

            os.environ['DATACUBE_ROOT'] = \
                config.get(test_name, 'datacube_root')

            self.logfile = self.open_logfile(test_name)

        except AssertionError as e:
            self.result = 'ERROR'
            self.error_message = e.message
dataset/ETHPy150Open GeoscienceAustralia/agdc/tests/systest.py/Systest.__init__/swapped operands of `%`