def __init__(self, conf): """conf is preup.conf.Conf object, contains configuration""" self.conf = conf if self.conf.debug is None: set_level(logging.INFO) else: set_level(logging.DEBUG) self.ui_helper = UIHelper(self.conf.maindir)
def setUp(self): self.tempdir = tempfile.mkdtemp() self.upgrade_dir = os.path.join(self.tempdir, "FOOBAR6_7") os.makedirs(self.upgrade_dir) self.puh = UIHelper(self.upgrade_dir) self.puh._group_name = self.group_name self.puh._content_name = self.content_name self.puh.check_script = True self.puh.solution_file = True content_dict = {} content_dict['check_script'] = "foobar_check_script.sh" content_dict['solution'] = "foobar_solution.txt" content_dict['content_title'] = "foobar_test_title" content_dict['content_description'] = "Foobar content test description" self.puh.content_dict = content_dict self.puh.content_path = os.path.join(self.puh.get_group_name(), self.puh.get_content_name()) if os.path.exists(self.puh.get_content_path()): shutil.rmtree(self.puh.get_content_path()) os.makedirs(self.puh.get_content_path()) self.puh.prepare_content_env() self.puh.create_final_content()