Пример #1
0
 def test_simple_clone(self):
     git = vcs.GitHelper('git')
     self.assertEqual(git.clone('git.clone1'),
                      'a7af835862da0e0592eeeac901b90e8de2cf5b67')
     self.assertEqual(git.clone('git.clone2'),
                      'a7af835862da0e0592eeeac901b90e8de2cf5b67')
     self.assertEqual(git.clone('git.clone3'),
                      'a7af835862da0e0592eeeac901b90e8de2cf5b67')
Пример #2
0
 def test_clone_at_head_1(self):
     git = vcs.GitHelper('git')
     self.assertEqual(
         git.clone('git.clone1',
                   '2f83e6d8189025e356a9563b8d78bdc8e2e9a3ed'),
         '2f83e6d8189025e356a9563b8d78bdc8e2e9a3ed')
     self.assertEqual(
         git.clone('git.clone2',
                   '2f83e6d8189025e356a9563b8d78bdc8e2e9a3ed'),
         '2f83e6d8189025e356a9563b8d78bdc8e2e9a3ed')
Пример #3
0
 def test_existing_destination(self):
     git = vcs.GitHelper('git')
     self.assertEqual(git.clone('git.clone1'), 'a7af835862da0e0592eeeac901b90e8de2cf5b67')
     self.assertRaises(InfrastructureError, git.clone, ('git.clone1'))
     self.assertRaises(InfrastructureError, git.clone, ('git'))
Пример #4
0
 def test_non_existing_git(self):
     git = vcs.GitHelper('does_not_exists')
     self.assertRaises(InfrastructureError, git.clone, ('foo.bar'))
Пример #5
0
 def test_clone_at_head(self):
     git = vcs.GitHelper('git')
     self.assertEqual(git.clone('git.clone1', 'a7af835862da0e0592eeeac901b90e8de2cf5b67'), 'a7af835862da0e0592eeeac901b90e8de2cf5b67')
Пример #6
0
 def test_invalid_commit(self):
     git = vcs.GitHelper('git')
     self.assertRaises(InfrastructureError, git.clone, 'foo.bar', 'badhash')
Пример #7
0
 def test_branch(self):
     git = vcs.GitHelper('git')
     self.assertEqual(git.clone('git.clone1', 'testing'),
                      'f2589a1b7f0cfc30ad6303433ba4d5db1a542c2d')