Exemplo n.º 1
0
def test_underscores_to_camelcase():

    tests = [
        ('', ''),
        ('test_me', 'TestMe'),
        ('Test_Me', 'TestMe'),
        ('test4_me', 'Test4Me'),
        ('test_4me', 'Test4me'),
        ('test_4_me', 'Test4Me')]

    for test in tests:
        assert utils.underscores_to_camelcase(test[0]) == test[1]
Exemplo n.º 2
0
def load_all():
    '''
    Scans the sprocket_support.validators package for "public" modules and loads
    their classes into the ALL_CLASSES dictionary.
    '''
    if not ALL_CLASSES:
        avail_tests = utils.public_modules_in_package(validators, ['tests'])
        for test_name in avail_tests:
            test_module_name = 'dns_sprockets_lib.validators.%s' % (test_name)
            test_module = importlib.import_module(test_module_name)
            ALL_CLASSES[test_name] = getattr(
                test_module, utils.underscores_to_camelcase(test_name))