# 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

    # with sort = True
    srs = rc.Series(sort=True)

    srs[1] = 2
    assert srs.data == [2]
    assert srs.index == [1]

    # srs[[0, 3]] - - set index = [0, 3]
    srs[[0, 3]] = 4
    assert srs.data == [4, 2, 4]
    assert srs.index == [0, 1, 3]

    # srs[1:2] - - set index slice 1:2
    srs[1:3] = 5
    assert srs.data == [4, 5, 5]
    assert srs.index == [0, 1, 3]
    assert srs.sort is True

    # insert
    srs[2] = 6
    assert srs.data == [4, 5, 6, 5]
    assert srs.index == [0, 1, 2, 3]


def test_append_row():
    actual = rc.Series([7, 9], index=[10, 12], sort=False)

    actual.append_row(9, 99)
    expected = rc.Series([7, 9, 99], index=[10, 12, 9])

# 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_set.py
import pytest
import raccoon as rc
from raccoon.utils import assert_series_equal


    # with sort = True
    srs = rc.Series(sort=True)

    srs[1] = 2
    assert srs.data == [2]
    assert srs.index == [1]

    # srs[[0, 3]] - - set index = [0, 3]
    srs[[0, 3]] = 4
    assert srs.data == [4, 2, 4]
    assert srs.index == [0, 1, 3]

    # srs[1:2] - - set index slice 1:2
    srs[1:3] = 5
    assert srs.data == [4, 5, 5]
    assert srs.index == [0, 1, 3]
    assert srs.sort is True

    # insert
    srs[2] = 6
    assert srs.data == [4, 5, 6, 5]
    assert srs.index == [0, 1, 2, 3]


def test_append_row():
    actual = rc.Series([7, 9], index=[10, 12], sort=False)

    actual.append_row(9, 99)
    expected = rc.Series([7, 9, 99], index=[10, 12, 9])

    assert_series_equal(actual, expected)