'get(use_sudo=True) works by copying to a temporary path, downloading it and then removing it at the end'

@server()
@with_fakes
def test_get_use_sudo(self):

    fake_run = Fake('_run_command', callable=True, expect_call=True).with_matching_args(fudge_arg.startswith('cp    -p    "/etc/apache2/apache2.conf"    "'), True, True, None).next_call().with_matching_args(fudge_arg.startswith('chown    username    "'), True, True, None).next_call().with_matching_args(fudge_arg.startswith('chmod    400    "'), True, True, None).next_call().with_matching_args(fudge_arg.startswith('rm    -f    "'), True, True, None)
    fake_get = Fake('get', callable=True, expect_call=True)
    with hide('everything'):
        with patched_context('fabric.operations', '_run_command', fake_run):
            with patched_context(SFTPClient, 'get', fake_get):
                retval = get('/etc/apache2/apache2.conf', self.path(), use_sudo=True)
                assert retval[0].endswith('apache2.conf')
