예제 #1
0
 def test_branches(self):
     self.assertEqual('44dac6b', repo.make_commit('one.txt'))
     current = functions.branch_name()
     GIT.checkout('-b', 'foo')
     self.assertEqual(repo.make_commit('two.txt'), '393ad1c')
     GIT.checkout(current)
     GIT.checkout('-b', 'bar')
     self.assertEqual(repo.make_commit('three.txt'), 'b6aee43')
     actual = GIT.for_each('-', 'git', 'log', '--oneline')
     self.assertEqual(actual, _BRANCHES.split('\n'))
예제 #2
0
 def test_directories(self):
     os.chdir(str(Path(__file__).parent.parent))
     actual = GIT.for_each('test/data/*', '-', 'ls', '-1', shell=True)
     self.assertEqual(actual, _DIRECTORIES.split('\n'))