# Path: pydatajson/helpers.py
# def fields_to_uppercase(fields):
#     uppercase_fields = fields.copy()
# 
#     for key in fields:
#         lower_key = key.lower()
#         upper_key = key.upper()
# 
#         if not key.isupper():
#             lowercase_counts = uppercase_fields.pop(lower_key, 0)
#             uppercase_counts = uppercase_fields.pop(upper_key, 0)
#             counts = uppercase_fields.pop(key, 0)
# 
#             uppercase_fields[upper_key] = \
#                 uppercase_counts + lowercase_counts + counts
# 
#     return uppercase_fields
# 
# Path: tests/context.py



import os.path
import unittest
import nose
import openpyxl as pyxl
from pydatajson.helpers import fields_to_uppercase
from .context import pydatajson
        from pydatajson.helpers import parse_repeating_time_interval_to_days
        from pydatajson.helpers import parse_repeating_time_interval_to_str





class HelpersTestCase(unittest.TestCase):

    SAMPLES_DIR = os.path.join("tests", "samples")
    RESULTS_DIR = os.path.join("tests", "results")

    def test_sheet_to_table(self):
        """sheet_to_table convierte hojas de un libro en listas de
        diccionarios"""
        workbook_path = os.path.join(self.SAMPLES_DIR,
                                     "prueba_sheet_to_table.xlsx")
        workbook = pyxl.load_workbook(workbook_path)

        expected_tables = {
            "Imperio": [
                {"Nombre": "Darth Vader", "Jedi": "Poderoso"},
                {"Nombre": "Kylo Ren", "Jedi": "Mas o Menos"}
            ],
            "Rebeldes": [
                {"Nombre": "Luke", "Edad": 56},
                {"Nombre": "Han", "Edad": 122},
                {"Nombre": "Yoda", "Edad": 0}
            ]
        }

        for sheetname in ["Imperio", "Rebeldes"]:

# Path: pydatajson/helpers.py
# def fields_to_uppercase(fields):
#     uppercase_fields = fields.copy()
# 
#     for key in fields:
#         lower_key = key.lower()
#         upper_key = key.upper()
# 
#         if not key.isupper():
#             lowercase_counts = uppercase_fields.pop(lower_key, 0)
#             uppercase_counts = uppercase_fields.pop(upper_key, 0)
#             counts = uppercase_fields.pop(key, 0)
# 
#             uppercase_fields[upper_key] = \
#                 uppercase_counts + lowercase_counts + counts
# 
#     return uppercase_fields
# 
# Path: tests/context.py



# Path: tests/test_helpers.py
import os.path
import unittest
import nose
import openpyxl as pyxl
from pydatajson.helpers import fields_to_uppercase
from .context import pydatajson
        from pydatajson.helpers import parse_repeating_time_interval_to_days
        from pydatajson.helpers import parse_repeating_time_interval_to_str






class HelpersTestCase(unittest.TestCase):

    SAMPLES_DIR = os.path.join("tests", "samples")
    RESULTS_DIR = os.path.join("tests", "results")

    def test_sheet_to_table(self):
        """sheet_to_table convierte hojas de un libro en listas de
        diccionarios"""
        workbook_path = os.path.join(self.SAMPLES_DIR,
                                     "prueba_sheet_to_table.xlsx")
        workbook = pyxl.load_workbook(workbook_path)

        expected_tables = {
            "Imperio": [
                {"Nombre": "Darth Vader", "Jedi": "Poderoso"},
                {"Nombre": "Kylo Ren", "Jedi": "Mas o Menos"}
            ],
            "Rebeldes": [
                {"Nombre": "Luke", "Edad": 56},
                {"Nombre": "Han", "Edad": 122},
                {"Nombre": "Yoda", "Edad": 0}
            ]
        }

        for sheetname in ["Imperio", "Rebeldes"]:

            actual_table = pydatajson.helpers.sheet_to_table(