|
|
@ -16,34 +16,34 @@ class TestGitPlugin(sand_env.SandboxedCommandTestCase):
|
|
|
|
|
|
|
|
|
|
|
|
def setUp(self, nsec_stat=True):
|
|
|
|
def setUp(self, nsec_stat=True):
|
|
|
|
super(TestGitPlugin, self).setUp()
|
|
|
|
super(TestGitPlugin, self).setUp()
|
|
|
|
self.execute_cmds(['pubs init'])
|
|
|
|
self.execute_cmds([('pubs init',)])
|
|
|
|
conf = config.load_conf(path=self.default_conf_path)
|
|
|
|
conf = config.load_conf(path=self.default_conf_path)
|
|
|
|
conf['plugins']['active'] = ['git']
|
|
|
|
conf['plugins']['active'] = ['git']
|
|
|
|
config.save_conf(conf, path=self.default_conf_path)
|
|
|
|
config.save_conf(conf, path=self.default_conf_path)
|
|
|
|
|
|
|
|
|
|
|
|
def test_git(self):
|
|
|
|
def test_git(self):
|
|
|
|
self.execute_cmds(['pubs add data/pagerank.bib'])
|
|
|
|
self.execute_cmds([('pubs add data/pagerank.bib',)])
|
|
|
|
hash_a = git_hash(self.default_pubs_dir)
|
|
|
|
hash_a = git_hash(self.default_pubs_dir)
|
|
|
|
|
|
|
|
|
|
|
|
self.execute_cmds(['pubs add data/pagerank.bib'])
|
|
|
|
self.execute_cmds([('pubs add data/pagerank.bib',)])
|
|
|
|
hash_b = git_hash(self.default_pubs_dir)
|
|
|
|
hash_b = git_hash(self.default_pubs_dir)
|
|
|
|
|
|
|
|
|
|
|
|
self.execute_cmds(['pubs rename Page99a ABC'])
|
|
|
|
self.execute_cmds([('pubs rename Page99a ABC',)])
|
|
|
|
hash_c = git_hash(self.default_pubs_dir)
|
|
|
|
hash_c = git_hash(self.default_pubs_dir)
|
|
|
|
|
|
|
|
|
|
|
|
self.execute_cmds([('pubs remove ABC', ['y']),])
|
|
|
|
self.execute_cmds([('pubs remove ABC', ['y']),])
|
|
|
|
hash_d = git_hash(self.default_pubs_dir)
|
|
|
|
hash_d = git_hash(self.default_pubs_dir)
|
|
|
|
|
|
|
|
|
|
|
|
self.execute_cmds(['pubs doc add testrepo/doc/Page99.pdf Page99'])
|
|
|
|
self.execute_cmds([('pubs doc add testrepo/doc/Page99.pdf Page99',)])
|
|
|
|
hash_e = git_hash(self.default_pubs_dir)
|
|
|
|
hash_e = git_hash(self.default_pubs_dir)
|
|
|
|
|
|
|
|
|
|
|
|
self.execute_cmds([('pubs doc remove Page99', ['y'])])
|
|
|
|
self.execute_cmds([('pubs doc remove Page99', ['y'])])
|
|
|
|
hash_f = git_hash(self.default_pubs_dir)
|
|
|
|
hash_f = git_hash(self.default_pubs_dir)
|
|
|
|
|
|
|
|
|
|
|
|
self.execute_cmds(['pubs tag Page99 bla+bli'])
|
|
|
|
self.execute_cmds([('pubs tag Page99 bla+bli',)])
|
|
|
|
hash_g = git_hash(self.default_pubs_dir)
|
|
|
|
hash_g = git_hash(self.default_pubs_dir)
|
|
|
|
|
|
|
|
|
|
|
|
self.execute_cmds(['pubs list'])
|
|
|
|
self.execute_cmds([('pubs list',)])
|
|
|
|
hash_h = git_hash(self.default_pubs_dir)
|
|
|
|
hash_h = git_hash(self.default_pubs_dir)
|
|
|
|
|
|
|
|
|
|
|
|
self.execute_cmds([('pubs edit Page99', ['@misc{Page99, title="TTT" author="X. YY"}', 'y',
|
|
|
|
self.execute_cmds([('pubs edit Page99', ['@misc{Page99, title="TTT" author="X. YY"}', 'y',
|
|
|
@ -63,7 +63,7 @@ class TestGitPlugin(sand_env.SandboxedCommandTestCase):
|
|
|
|
conf['plugins']['active'] = []
|
|
|
|
conf['plugins']['active'] = []
|
|
|
|
config.save_conf(conf, path=self.default_conf_path)
|
|
|
|
config.save_conf(conf, path=self.default_conf_path)
|
|
|
|
|
|
|
|
|
|
|
|
self.execute_cmds(['pubs add data/pagerank.bib'])
|
|
|
|
self.execute_cmds([('pubs add data/pagerank.bib',)])
|
|
|
|
hash_j = git_hash(self.default_pubs_dir)
|
|
|
|
hash_j = git_hash(self.default_pubs_dir)
|
|
|
|
|
|
|
|
|
|
|
|
self.assertEqual(hash_i, hash_j)
|
|
|
|
self.assertEqual(hash_i, hash_j)
|
|
|
@ -73,17 +73,17 @@ class TestGitPlugin(sand_env.SandboxedCommandTestCase):
|
|
|
|
conf['plugins']['git']['manual'] = True
|
|
|
|
conf['plugins']['git']['manual'] = True
|
|
|
|
config.save_conf(conf, path=self.default_conf_path)
|
|
|
|
config.save_conf(conf, path=self.default_conf_path)
|
|
|
|
|
|
|
|
|
|
|
|
self.execute_cmds(['pubs add data/pagerank.bib'])
|
|
|
|
self.execute_cmds([('pubs add data/pagerank.bib',)])
|
|
|
|
hash_k = git_hash(self.default_pubs_dir)
|
|
|
|
hash_k = git_hash(self.default_pubs_dir)
|
|
|
|
|
|
|
|
|
|
|
|
self.assertEqual(hash_j, hash_k)
|
|
|
|
self.assertEqual(hash_j, hash_k)
|
|
|
|
|
|
|
|
|
|
|
|
self.execute_cmds(['pubs git add .'])
|
|
|
|
self.execute_cmds([('pubs git add .',)])
|
|
|
|
hash_l = git_hash(self.default_pubs_dir)
|
|
|
|
hash_l = git_hash(self.default_pubs_dir)
|
|
|
|
|
|
|
|
|
|
|
|
self.assertEqual(hash_k, hash_l)
|
|
|
|
self.assertEqual(hash_k, hash_l)
|
|
|
|
|
|
|
|
|
|
|
|
self.execute_cmds(['pubs git commit -m "abc"'])
|
|
|
|
self.execute_cmds([('pubs git commit -m "abc"',)])
|
|
|
|
hash_m = git_hash(self.default_pubs_dir)
|
|
|
|
hash_m = git_hash(self.default_pubs_dir)
|
|
|
|
|
|
|
|
|
|
|
|
self.assertNotEqual(hash_l, hash_m)
|
|
|
|
self.assertNotEqual(hash_l, hash_m)
|
|
|
|