# Path: raccoon/utils.py
# def assert_frame_equal(left, right, data_function=None, data_args=None):
#     """
#     For unit testing equality of two DataFrames.
# 
#     :param left: first DataFrame
#     :param right: second DataFrame
#     :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
#     """
#     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.columns == right.columns
#     assert left.index_name == right.index_name
#     assert left.sort == right.sort
#     assert left.dropin == right.dropin


import pytest
import raccoon as rc
from raccoon.utils import assert_frame_equal

    df.delete_rows('b')
    assert_frame_equal(df, rc.DataFrame(columns=['b', 'a'], sort=False))

    # insert back in data
    df[1, 'a'] = 9
    assert df.data == [[None], [9]]

    df[2, 'b'] = 8
    assert df.data == [[None, 8], [9, None]]

    df = rc.DataFrame({'a': [1, 2, 3], 'b': [4, 5, 6]}, index=['a', 'b', 'c'], columns=['b', 'a'])
    # cannot delete values not in index
    with pytest.raises(ValueError):
        df.delete_rows(['bad'])

    # length of boolean must be len of index
    with pytest.raises(ValueError):
        df.delete_rows([True, False])

    df.delete_rows([True, False, True])
    assert_frame_equal(df, rc.DataFrame({'a': [2], 'b': [5]}, columns=['b', 'a'], index=['b']))

    df.delete_rows([True])
    assert_frame_equal(df, rc.DataFrame(columns=['b', 'a'], sort=False))


def test_delete_row_sorted():
    df = rc.DataFrame({'a': [1, 2, 3], 'b': [4, 5, 6]}, index=['a', 'b', 'c'], columns=['b', 'a'], sort=True)


# Path: raccoon/utils.py
# def assert_frame_equal(left, right, data_function=None, data_args=None):
#     """
#     For unit testing equality of two DataFrames.
# 
#     :param left: first DataFrame
#     :param right: second DataFrame
#     :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
#     """
#     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.columns == right.columns
#     assert left.index_name == right.index_name
#     assert left.sort == right.sort
#     assert left.dropin == right.dropin


# Path: tests/test_dataframe/test_delete.py
import pytest
import raccoon as rc
from raccoon.utils import assert_frame_equal


    df.delete_rows('b')
    assert_frame_equal(df, rc.DataFrame(columns=['b', 'a'], sort=False))

    # insert back in data
    df[1, 'a'] = 9
    assert df.data == [[None], [9]]

    df[2, 'b'] = 8
    assert df.data == [[None, 8], [9, None]]

    df = rc.DataFrame({'a': [1, 2, 3], 'b': [4, 5, 6]}, index=['a', 'b', 'c'], columns=['b', 'a'])
    # cannot delete values not in index
    with pytest.raises(ValueError):
        df.delete_rows(['bad'])

    # length of boolean must be len of index
    with pytest.raises(ValueError):
        df.delete_rows([True, False])

    df.delete_rows([True, False, True])
    assert_frame_equal(df, rc.DataFrame({'a': [2], 'b': [5]}, columns=['b', 'a'], index=['b']))

    df.delete_rows([True])
    assert_frame_equal(df, rc.DataFrame(columns=['b', 'a'], sort=False))


def test_delete_row_sorted():
    df = rc.DataFrame({'a': [1, 2, 3], 'b': [4, 5, 6]}, index=['a', 'b', 'c'], columns=['b', 'a'], sort=True)


    df.delete_rows(['a', 'c'])