def test_issue_51_normal_dict_in_records(): from pyexcel.plugins.sources.pydata.records import RecordsReader records = [] orderred_dict = {} orderred_dict.update({"Zebra": 10}) orderred_dict.update({"Hippo": 9}) orderred_dict.update({"Monkey": 8}) records.append(orderred_dict) orderred_dict2 = {} orderred_dict2.update({"Zebra": 1}) orderred_dict2.update({"Hippo": 2}) orderred_dict2.update({"Monkey": 3}) records.append(orderred_dict2) records_reader = RecordsReader(records) array = list(records_reader.to_array()) expected = [['Hippo', 'Monkey', 'Zebra'], [9, 8, 10], [2, 3, 1]] eq_(array, expected)
def test_issue_51_orderred_dict_in_records(): from pyexcel.plugins.sources.pydata.records import RecordsReader records = [] orderred_dict = OrderedDict() orderred_dict.update({"Zebra": 10}) orderred_dict.update({"Hippo": 9}) orderred_dict.update({"Monkey": 8}) records.append(orderred_dict) orderred_dict2 = OrderedDict() orderred_dict2.update({"Zebra": 1}) orderred_dict2.update({"Hippo": 2}) orderred_dict2.update({"Monkey": 3}) records.append(orderred_dict2) records_reader = RecordsReader(records) array = list(records_reader.to_array()) expected = [['Zebra', 'Hippo', 'Monkey'], [10, 9, 8], [1, 2, 3]] eq_(array, expected)