def METHOD_NAME(
    tmp_path: pathlib.Path,
    conn_cnx,
    auto_compress,
):
    """Tests PUT command with auto_compress=False|True."""
    _test_name = random_string(5, "test_auto_compress_switch")
    test_data, file_name = _prepare_tmp_file(tmp_path)
    with conn_cnx() as cnx:
        cnx.cursor().execute(f"RM @~/{_test_name}")
        try:
            file_stream = test_data.open("rb")
            with cnx.cursor() as cur:
                put(
                    cur,
                    str(test_data),
                    f"~/{_test_name}",
                    False,
                    sql_options=f"auto_compress={auto_compress}",
                    file_stream=file_stream,
                )
            ret = cnx.cursor().execute(f"LS @~/{_test_name}").fetchone()
            uploaded_gz_name = f"{file_name}.gz"
            if auto_compress:
                assert uploaded_gz_name in ret[0]
            else:
                assert uploaded_gz_name not in ret[0]
            # get this file, if the client handle compression meta correctly
            get_dir = tmp_path / "get_dir"
            get_dir.mkdir()
            cnx.cursor().execute(f"GET @~/{_test_name}/{file_name} file://{get_dir}")
            downloaded_file = get_dir / (
                uploaded_gz_name if auto_compress else file_name
            )
            assert downloaded_file.exists()
            if not auto_compress:
                assert filecmp.cmp(test_data, downloaded_file)
        finally:
            cnx.cursor().execute(f"RM @~/{_test_name}")
            if file_stream:
                file_stream.close()