# 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
    # test boolean list not same length as columns
    with pytest.raises(ValueError):
        df.get(99, [True, False])

    # test index out of bounds
    with pytest.raises(ValueError):
        df.get(88, ['a', 'c'])


def test_get_matrix():
    df = rc.DataFrame({'a': [1, 2, 3], 'b': [4, 5, 6], 'c': [7, 8, 9], 'd': [10, 11, 12]}, index=['x', 'y', 'z'],
                      columns=['a', 'b', 'c', 'd'], index_name='letters', sort=False)

    expected = rc.DataFrame({'b': [4, 6], 'd': [10, 12]}, index=['x', 'z'], columns=['b', 'd'], index_name='letters',
                            sort=False)
    actual = df.get(['x', 'z'], ['b', 'd'])
    assert_frame_equal(actual, expected)

    # test with booleans
    actual = df.get([True, False, True], [False, True, False, True])
    assert_frame_equal(actual, expected)

    # columns out of order
    expected = rc.DataFrame({'d': [10, 12], 'c': [7, 9]}, index=['x', 'z'], columns=['d', 'c'], index_name='letters',
                            sort=False)
    actual = df.get(['x', 'z'], ['d', 'c'])
    assert_frame_equal(actual, expected)

    # get everything
    everything = df.get()

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

    # test boolean list not same length as columns
    with pytest.raises(ValueError):
        df.get(99, [True, False])

    # test index out of bounds
    with pytest.raises(ValueError):
        df.get(88, ['a', 'c'])


def test_get_matrix():
    df = rc.DataFrame({'a': [1, 2, 3], 'b': [4, 5, 6], 'c': [7, 8, 9], 'd': [10, 11, 12]}, index=['x', 'y', 'z'],
                      columns=['a', 'b', 'c', 'd'], index_name='letters', sort=False)

    expected = rc.DataFrame({'b': [4, 6], 'd': [10, 12]}, index=['x', 'z'], columns=['b', 'd'], index_name='letters',
                            sort=False)
    actual = df.get(['x', 'z'], ['b', 'd'])
    assert_frame_equal(actual, expected)

    # test with booleans
    actual = df.get([True, False, True], [False, True, False, True])
    assert_frame_equal(actual, expected)

    # columns out of order
    expected = rc.DataFrame({'d': [10, 12], 'c': [7, 9]}, index=['x', 'z'], columns=['d', 'c'], index_name='letters',
                            sort=False)
    actual = df.get(['x', 'z'], ['d', 'c'])
    assert_frame_equal(actual, expected)

    # get everything
    everything = df.get()

    assert_frame_equal(everything, df)