def register_test(test_name, test_function):
    """ Register a new one-argument test function """
    if not isinstance(test_name, basestring):
        raise TypeError("Cannot register a non-string test name")
    elif test_name in VALIDATOR_TESTS:
        raise ValueError(
            "Cannot register a test name that already exists: {0}".format(test_name))
    VALIDATOR_TESTS[test_name] = test_function
dataset/ETHPy150Open svanoort/pyresttest/pyresttest/validators.py/register_test/original