def test_manual(self): conf = config.load_conf(path=self.default_conf_path) conf['plugins']['active'] = ['git'] conf['plugins']['git']['manual'] = True config.save_conf(conf, path=self.default_conf_path) # this three lines just to initialize the git HEAD self.execute_cmds([('pubs add data/pagerank.bib', )]) self.execute_cmds([('pubs git add .', )]) self.execute_cmds([('pubs git commit -m "initial_commit"', )]) self.execute_cmds([('pubs add data/pagerank.bib', )]) hash_j = git_hash(self.default_pubs_dir) self.execute_cmds([('pubs add data/pagerank.bib', )]) hash_k = git_hash(self.default_pubs_dir) self.assertEqual(hash_j, hash_k) self.execute_cmds([('pubs git add .', )]) hash_l = git_hash(self.default_pubs_dir) self.assertEqual(hash_k, hash_l) self.execute_cmds([('pubs git commit -m "abc"', )]) hash_m = git_hash(self.default_pubs_dir) self.assertNotEqual(hash_l, hash_m)
def setUp(self, nsec_stat=True): super(TestGitPlugin, self).setUp() # Backup environment variables and set git author self.env_backup = os.environ.copy() os.environ['GIT_AUTHOR_NAME'] = "Pubs test" os.environ['GIT_AUTHOR_EMAIL'] = "*****@*****.**" # Setup pubs repository self.execute_cmds([('pubs init', )]) conf = config.load_conf(path=self.default_conf_path) conf['plugins']['active'] = ['git'] config.save_conf(conf, path=self.default_conf_path)
def load_conf(self, library): """Load configuration file in pubs. Parameters ---------- config : TODO Returns ------- TODO """ conf = load_conf(library) conf['main']['edit_cmd'] = self._editor conf.write() init_ui(conf) plugins.load_plugins(conf, uis._ui) return conf
def setUp(self, nsec_stat=True): super(TestGitPlugin, self).setUp() self.execute_cmds([('pubs init', )]) conf = config.load_conf(path=self.default_conf_path) conf['plugins']['active'] = ['git'] config.save_conf(conf, path=self.default_conf_path)