# Path: _import.py
# def normalize_tag(tag):
#     if tag in normalized_tags_cache:
#         return normalized_tags_cache[tag]
# 
#     normalized_tag = remove_namespace(tag)
# 
#     # http://stackoverflow.com/a/1176023/4308
#     normalized_tag = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', normalized_tag)
#     normalized_tag = re.sub('([a-z0-9])([A-Z])', r'\1_\2', normalized_tag)
#     normalized_tag = normalized_tag.lower()
# 
#     normalized_tags_cache[tag] = normalized_tag
#     return normalized_tag


from _import import normalize_tag
# vim: set fileencoding=utf-8 :



class TestImport(object):

    def test_normalize_tag(self):
        assert normalize_tag('{http://www.suunto.com/schemas/sml}SwimPace') == 'swim_pace'

# Path: _import.py
# def normalize_tag(tag):
#     if tag in normalized_tags_cache:
#         return normalized_tags_cache[tag]
# 
#     normalized_tag = remove_namespace(tag)
# 
#     # http://stackoverflow.com/a/1176023/4308
#     normalized_tag = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', normalized_tag)
#     normalized_tag = re.sub('([a-z0-9])([A-Z])', r'\1_\2', normalized_tag)
#     normalized_tag = normalized_tag.lower()
# 
#     normalized_tags_cache[tag] = normalized_tag
#     return normalized_tag


# Path: tests/test_import.py
from _import import normalize_tag

# vim: set fileencoding=utf-8 :



class TestImport(object):

    def test_normalize_tag(self):
        assert normalize_tag('{http://www.suunto.com/schemas/sml}SwimPace') == 'swim_pace'

        assert normalize_tag('ascentTime') == 'ascent_time'