def test_form_POST_file_redirected_stdin(httpbin):
    """
    <https://github.com/httpie/cli/issues/840>

    """
    with open(FILE_PATH, encoding=UTF8):
        r = http(
            '--form',
            'POST',
            httpbin + '/post',
            f'file@{FILE_PATH}',
            tolerate_error_exit_status=True,
            env=MockEnvironment(
                stdin=StdinBytesIO(FILE_PATH.read_bytes()),
                stdin_isatty=False,
            ),
        )
    assert r.exit_status == ExitStatus.ERROR
    assert 'cannot be mixed' in r.stderr

    <https://github.com/httpie/cli/issues/840>

    
tests/test_httpie.py