Пример #1
0
def git_clone_salt():

    from salt.modules import git

    git.clone(
        cwd='/home/tony/study/salt/_salt',
        repository='https://github.com/saltstack/salt',
    )
Пример #2
0
 def test_clone(self):
     '''
     Test if it clone a new repository
     '''
     mock = MagicMock(return_value={'retcode': 0, 'stdout': True})
     with patch.dict(git.__salt__, {'cmd.run_all': mock,
                                    'cmd.run_stdout': True}):
         self.assertTrue(git.clone('origin', 'develop'))