# Path: raccoon/utils.py
# def assert_series_equal(left, right, data_function=None, data_args=None):
#     """
#     For unit testing equality of two Series.
# 
#     :param left: first Series
#     :param right: second Series
#     :param data_function: if provided will use this function to assert compare the df.data
#     :param data_args: arguments to pass to the data_function
#     :return: nothing
#     """
#     assert type(left) == type(right)
#     if data_function:
#         data_args = {} if not data_args else data_args
#         data_function(left.data, right.data, **data_args)
#     else:
#         assert left.data == right.data
#     assert left.index == right.index
#     assert left.data_name == right.data_name
#     assert left.index_name == right.index_name
#     assert left.sort == right.sort
#     if isinstance(left, rc.ViewSeries):
#         assert left.offset == right.offset
#     if isinstance(left, rc.Series):
#         assert left.dropin == right.dropin


import pytest
import raccoon as rc
from raccoon.utils import assert_series_equal
    # initializing with sort does not change the data or index. The sort is a flag to speed up gets
    df = rc.ViewSeries([5, 4, 6], index=[12, 11, 13], sort=True)
    assert df.sort is True
    assert df.index == [12, 11, 13]
    assert df.data == [5, 4, 6]

    # cannot change sort status
    df = rc.ViewSeries([5, 4, 6], index=[12, 11, 13], sort=False)
    with pytest.raises(AttributeError):
        # noinspection PyPropertyAccess
        df.sort = True


def test_bad_initialization():
    # cannot initialize empty
    with pytest.raises(ValueError):
        rc.ViewSeries()

    # data with no index not allowed
    with pytest.raises(ValueError):
        rc.ViewSeries(data=[1, 2, 3])

    # index with no data not allowed
    with pytest.raises(ValueError):
        rc.ViewSeries(index=[1, 2, 3])

    # wrong length of index
    with pytest.raises(ValueError):
        rc.ViewSeries([1, 2, 3], index=[1])


# Path: raccoon/utils.py
# def assert_series_equal(left, right, data_function=None, data_args=None):
#     """
#     For unit testing equality of two Series.
# 
#     :param left: first Series
#     :param right: second Series
#     :param data_function: if provided will use this function to assert compare the df.data
#     :param data_args: arguments to pass to the data_function
#     :return: nothing
#     """
#     assert type(left) == type(right)
#     if data_function:
#         data_args = {} if not data_args else data_args
#         data_function(left.data, right.data, **data_args)
#     else:
#         assert left.data == right.data
#     assert left.index == right.index
#     assert left.data_name == right.data_name
#     assert left.index_name == right.index_name
#     assert left.sort == right.sort
#     if isinstance(left, rc.ViewSeries):
#         assert left.offset == right.offset
#     if isinstance(left, rc.Series):
#         assert left.dropin == right.dropin


# Path: tests/test_series/test_view_series.py
import pytest
import raccoon as rc
from raccoon.utils import assert_series_equal

    # initializing with sort does not change the data or index. The sort is a flag to speed up gets
    df = rc.ViewSeries([5, 4, 6], index=[12, 11, 13], sort=True)
    assert df.sort is True
    assert df.index == [12, 11, 13]
    assert df.data == [5, 4, 6]

    # cannot change sort status
    df = rc.ViewSeries([5, 4, 6], index=[12, 11, 13], sort=False)
    with pytest.raises(AttributeError):
        # noinspection PyPropertyAccess
        df.sort = True


def test_bad_initialization():
    # cannot initialize empty
    with pytest.raises(ValueError):
        rc.ViewSeries()

    # data with no index not allowed
    with pytest.raises(ValueError):
        rc.ViewSeries(data=[1, 2, 3])

    # index with no data not allowed
    with pytest.raises(ValueError):
        rc.ViewSeries(index=[1, 2, 3])

    # wrong length of index
    with pytest.raises(ValueError):
        rc.ViewSeries([1, 2, 3], index=[1])


    with pytest.raises(ValueError):