# 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
            "dict_anidado": {
                "valor": 36
            }
        }
        result = pydatajson.helpers.add_dicts(one_dict, other_dict)
        self.assertDictEqual(result, expected)

    def test_parse_date_string(self):
        self.assertEqual(pydatajson.helpers.parse_date_string(""), None)

    def test_title_to_name(self):
        self.assertEqual(
            pydatajson.helpers.title_to_name(
                "Exportación en $   de tomates  año 2017 (*)"),
            "exportacion-tomates-ano-2017"
        )

    def test_fields_to_uppercase_returns_unique_uppercase_keys(self):
        fields = {
            'csv': 10,
            'CSV': 20,
            'json': 30,
            'JSON': 40
        }

        expected = {
            'CSV': 30,
            'JSON': 70
        }


# 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

            "dict_anidado": {
                "valor": 36
            }
        }
        result = pydatajson.helpers.add_dicts(one_dict, other_dict)
        self.assertDictEqual(result, expected)

    def test_parse_date_string(self):
        self.assertEqual(pydatajson.helpers.parse_date_string(""), None)

    def test_title_to_name(self):
        self.assertEqual(
            pydatajson.helpers.title_to_name(
                "Exportación en $   de tomates  año 2017 (*)"),
            "exportacion-tomates-ano-2017"
        )

    def test_fields_to_uppercase_returns_unique_uppercase_keys(self):
        fields = {
            'csv': 10,
            'CSV': 20,
            'json': 30,
            'JSON': 40
        }

        expected = {
            'CSV': 30,
            'JSON': 70
        }


        self.assertEqual(fields_to_uppercase(fields), expected)