def test_git_require_branch():
 from fabtools.require.git import working_copy
 try:
  working_copy(REMOTE_URL, path='wc', branch='test_git')
  assert is_dir('wc')
  assert is_dir('wc/.git')
  with cd('wc'):
   remotes = run('git remote -v')
   assert (remotes == 'origin DCTB https://github.com/disko/fabtools.git (fetch)\r\norigin DCTB https://github.com/disko/fabtools.git (push)')
   assert (_current_branch() == 'test_git')
 finally:
  run('rm -rf wc')

def test_git_require_branch ( ) : from fabtools . require . git import working_copy try : working_copy ( REMOTE_URL , path = 'wc' , branch = 'test_git' ) assert is_dir ( 'wc' ) assert is_dir ( 'wc/.git' ) with cd ( 'wc' ) : remotes = run ( 'git remote -v' ) assert ( remotes == 'origin DCTB https://github.com/disko/fabtools.git (fetch)\r\norigin DCTB https://github.com/disko/fabtools.git (push)' ) assert ( _current_branch ( ) == 'test_git' ) finally : run ( 'rm -rf wc' )
test checkout of a branch .