def test_test_type_to_str():

    tests = {
        ((validators.ZONE_TEST, None), 'ZONE_TEST'),
        ((validators.ZONE_TEST, ''), 'ZONE_TEST'),
        ((validators.ZONE_TEST, 'SOA'), 'ZONE_TEST[SOA]'),
        ((validators.ZONE_TEST, 'SOA,NS'), 'ZONE_TEST[SOA,NS]'),
        ((validators.NODE_TEST, 'A,AAAA'), 'NODE_TEST[A,AAAA]'),
        ((validators.RRSET_TEST, None), 'RRSET_TEST'),
        ((validators.REC_TEST, None), 'REC_TEST')}

    for test in tests:
        assert validators.test_type_to_str(test[0][0], test[0][1]) == test[1]
def get_formatted_descriptions():
    '''
    Gets a formatted string containing descriptions of all validators in the
    ALL_CLASSES dictionary.
    '''
    descs = _get_descriptions()
    return '\n'.join(
        ['TEST: %s (%s) - %s%s' % (
            td[0],
            validators.test_type_to_str(td[2], td[3]),
            td[1],
            ''.join(sorted(
                ['\n    DEFINE: (%s_)%s - %s (default=%s)' % (
                    td[0], opt_name, opt_val[1], opt_val[0])
                 for (opt_name, opt_val) in td[4].iteritems()])))
         for td in descs])