def test_package_driver_real(self): """ Test with real hypm ctd driver code """ # link current metadata dsa file to a real driver, the ctd current_dsa_path = Config().idk_config_dir() + "/current_dsa.yml" ctd_md_path = "%s/%s/hypm/ctd/metadata.yml" % (Config().base_dir(), MI_BASE_DIR) log.info("linking %s to %s", ctd_md_path, current_dsa_path) # exists doesn't catch when this link is broken but still there, # need to figure out how to find and delete if exists(current_dsa_path): os.remove(current_dsa_path) os.symlink(ctd_md_path, current_dsa_path) # create the metadata so we can use it for opening the egg metadata = Metadata() # create the egg with the package driver package_driver = PackageDriver() package_driver.run() startup_config = {"harvester": {"directory": "/tmp/dsatest", "pattern": "*.txt", "frequency": 1}, "parser": {}} # load the driver cotr = self.load_egg(metadata) # need to load with the right number of arguments egg_driver = cotr(startup_config, None, None, None, None) log.info("driver loaded")
def test_package_driver_real(self): """ Test with real hypm ctd driver code """ # link current metadata dsa file to a real driver, the ctd current_dsa_path = Config().idk_config_dir() + "/current_dsa.yml" ctd_md_path = "%s/%s/hypm/ctd/metadata.yml" % (Config().base_dir(), MI_BASE_DIR) log.info("linking %s to %s", ctd_md_path, current_dsa_path) # exists doesn't catch when this link is broken but still there, # need to figure out how to find and delete if exists(current_dsa_path): os.remove(current_dsa_path) log.error(current_dsa_path) os.symlink(ctd_md_path, current_dsa_path) # create the metadata so we can use it for opening the egg metadata = Metadata() # create the egg with the package driver package_driver = PackageDriver() package_driver.run() startup_config = { 'harvester': { 'directory': '/tmp/dsatest', 'pattern': '*.txt', 'frequency': 1, }, 'parser': {} } # load the driver cotr = self.load_egg(metadata) # need to load with the right number of arguments egg_driver = cotr(startup_config, None, None, None, None) log.info("driver loaded")
def run(): app = PackageDriver() app.run()