def test_identity_rotation(w):
    # Rotation by 1 should be identity operation
    W_in = w()
    W_out = w()
    assert W_in.ensure_validity(alter=False)
    assert W_out.ensure_validity(alter=False)
    W_out.rotate_decomposition_basis(quaternion.one)
    assert W_out.ensure_validity(alter=False)
    assert np.array_equal(W_out.t, W_in.t)
    assert np.array_equal(W_out.frame, W_in.frame)
    assert np.array_equal(W_out.data, W_in.data)
    assert np.array_equal(W_out.LM, W_in.LM)
    assert W_out.ell_min == W_in.ell_min
    assert W_out.ell_max == W_in.ell_max
    for h_in, h_out in zip(W_in.history, W_out.history[:-1]):
        assert h_in == h_out.replace(
            f"{type(W_out).__name__}_{str(W_out.num)}", f"{type(W_in).__name__}_{str(W_in.num)}"
        ) or (h_in.startswith("# ") and h_out.startswith("# "))
    assert W_out.frameType == W_in.frameType
    assert W_out.dataType == W_in.dataType
    assert W_out.r_is_scaled_out == W_in.r_is_scaled_out
    assert W_out.m_is_scaled_out == W_in.m_is_scaled_out
    assert isinstance(W_out.num, int)
    assert W_out.num != W_in.num