def test_git_require_sudo():

    from fabtools.require.git import working_copy

    try:
        working_copy(REMOTE_URL, path='wc_root', use_sudo=True)

        assert is_dir('wc_root')
        assert is_dir('wc_root/.git')

        with cd('wc_root'):
            remotes = run('git remote -v')
            assert remotes == \
                'origin\thttps://github.com/disko/fabtools.git (fetch)\r\n' \
                'origin\thttps://github.com/disko/fabtools.git (push)'

            assert _current_branch() == 'master'

        assert owner('wc_root') == 'root'
        assert group('wc_root') == 'root'

    finally:
        run_as_root('rm -rf wc_root')
Test working_copy() with sudo
dataset/ETHPy150Open ronnix/fabtools/fabtools/tests/functional_tests/test_git.py/test_git_require_sudo