# 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


from collections import OrderedDict
from copy import deepcopy
from raccoon.utils import assert_frame_equal
import pytest
import raccoon as rc

    # cannot to_list on a multi-column DataFrame
    with pytest.raises(TypeError):
        df.to_list()


def test_json():
    df = rc.DataFrame({'a': [1, 2, 3], 'b': [4, 5, 6], 'c': [7, 8, 9]}, index=[4, 5, 6], columns=['b', 'a', 'c'])

    string = df.to_json()
    actual = rc.DataFrame.from_json(string)
    assert_frame_equal(df, actual)

    # empty DataFrame
    df = rc.DataFrame({'a': [], 'b': [], 'c': []})
    string = df.to_json()
    actual = rc.DataFrame.from_json(string)
    assert_frame_equal(df, actual)

    df = rc.DataFrame()
    string = df.to_json()
    actual = rc.DataFrame.from_json(string)
    assert_frame_equal(df, actual)


def test_json_multi_index():
    df = rc.DataFrame({'a': [1, 2, 3], 'b': [4, 5, 6], 'c': [7, 8, 9]}, index=[('a', 4), ('b', 5), ('c', 6)])

    string = df.to_json()
    actual = rc.DataFrame.from_json(string)

# 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_dataframe.py
from collections import OrderedDict
from copy import deepcopy
from raccoon.utils import assert_frame_equal
import pytest
import raccoon as rc


    # cannot to_list on a multi-column DataFrame
    with pytest.raises(TypeError):
        df.to_list()


def test_json():
    df = rc.DataFrame({'a': [1, 2, 3], 'b': [4, 5, 6], 'c': [7, 8, 9]}, index=[4, 5, 6], columns=['b', 'a', 'c'])

    string = df.to_json()
    actual = rc.DataFrame.from_json(string)
    assert_frame_equal(df, actual)

    # empty DataFrame
    df = rc.DataFrame({'a': [], 'b': [], 'c': []})
    string = df.to_json()
    actual = rc.DataFrame.from_json(string)
    assert_frame_equal(df, actual)

    df = rc.DataFrame()
    string = df.to_json()
    actual = rc.DataFrame.from_json(string)
    assert_frame_equal(df, actual)


def test_json_multi_index():
    df = rc.DataFrame({'a': [1, 2, 3], 'b': [4, 5, 6], 'c': [7, 8, 9]}, index=[('a', 4), ('b', 5), ('c', 6)])

    string = df.to_json()
    actual = rc.DataFrame.from_json(string)

    assert_frame_equal(df, actual)