# Path: native_tags/registry.py
# def register(self, bucket, name_or_func, func=None):
#     """
#     Add a function to the registry by name
#     """
#     assert bucket in self, 'Bucket %s is unknown' % bucket
#     if func is None and hasattr(name_or_func, '__name__'):
#         name = name_or_func.__name__
#         func = name_or_func
#     elif func:
#         name = name_or_func
#     if name in self[bucket]:
#         raise AlreadyRegistered('The function %s is already registered' % name)
# 
#     self[bucket][name] = func


from django.test import TestCase
from native_tags.registry import register


def tester(f):
    def inner(unit):
        args, kwargs = f.test.get('args', ()), f.test.get('kwargs', {})
        result = len(kwargs) and f(*args, **kwargs) or f(*args)
        unit.assertEquals(result, f.test.get('result', True))
    return inner

attrs = {}


# Path: native_tags/registry.py
# def register(self, bucket, name_or_func, func=None):
#     """
#     Add a function to the registry by name
#     """
#     assert bucket in self, 'Bucket %s is unknown' % bucket
#     if func is None and hasattr(name_or_func, '__name__'):
#         name = name_or_func.__name__
#         func = name_or_func
#     elif func:
#         name = name_or_func
#     if name in self[bucket]:
#         raise AlreadyRegistered('The function %s is already registered' % name)
# 
#     self[bucket][name] = func


# Path: native_tags/tests.py
from django.test import TestCase
from native_tags.registry import register



def tester(f):
    def inner(unit):
        args, kwargs = f.test.get('args', ()), f.test.get('kwargs', {})
        result = len(kwargs) and f(*args, **kwargs) or f(*args)
        unit.assertEquals(result, f.test.get('result', True))
    return inner

attrs = {}


for bucket,items in register.items():