'put(use_sudo=True, temp_dir=\'/tmp/\') works by uploading a file to /tmp/ and then moving it to a `remote_path`'

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

    fake_run = Fake('_run_command', callable=True, expect_call=True).with_matching_args(fudge_arg.startswith('mv    "'), True, True, None)
    fake_put = Fake('put', callable=True, expect_call=True)
    local_path = self.mkfile('foobar.txt', 'baz')
    with hide('everything'):
        with patched_context('fabric.operations', '_run_command', fake_run):
            with patched_context(SFTPClient, 'put', fake_put):
                retval = put(local_path, '/', use_sudo=True, temp_dir='/tmp/')
                assert retval[0].endswith('foobar.txt')
