'Check that the emulation of the legacy interface is (almost) total'

def test_legacy_coverage(self):

    cl = self.cloned_library
    db = self.init_old(cl)
    ndb = self.init_legacy()
    SKIP_ATTRS = {u'TCat_Tag', u'_add_newbook_tag', u'_clean_identifier', u'_library_id_', u'_set_authors', u'_set_title', u'_set_custom', u'_update_author_in_cache', u'get_feeds', u'get_feed', u'update_feed', u'remove_feeds', u'add_feed', u'set_feeds', u'author_id', u'books_for_author', u'books_in_old_database', u'sizeof_old_database', u'migrate_old', u'remove_unused_series', u'move_library_to', u'find_books_in_directory', u'import_book_directory', u'import_book_directory_multiple', u'recursive_import', u'clean_user_categories', u'cleanup_tags', u'books_list_filter', u'conn', u'connect', u'construct_file_name', u'construct_path_name', u'clear_dirtied', u'initialize_database', u'initialize_dynamic', u'run_import_plugins', u'vacuum', u'set_path', u'row_factory', u'rows', u'rmtree', u'series_index_pat', u'import_old_database', u'dirtied_lock', u'dirtied_cache', u'dirty_books_referencing', u'windows_check_if_files_in_use', u'get_metadata_for_dump', u'get_a_dirtied_book', u'dirtied_sequence', u'format_filename_cache', u'format_metadata_cache', u'filter', u'create_version1', u'normpath', u'custom_data_adapters', u'custom_table_names', u'custom_columns_in_meta', u'custom_tables'}
    SKIP_ARGSPEC = {u'__init__'}
    missing = []
    try:
        total = 0
        for attr in dir(db):
            if ((attr in SKIP_ATTRS) or attr.startswith(u'upgrade_version')):
                continue
            total += 1
            if (not hasattr(ndb, attr)):
                missing.append(attr)
                continue
            (obj, nobj) = (getattr(db, attr), getattr(ndb, attr))
            if (attr not in SKIP_ARGSPEC):
                try:
                    argspec = inspect.getargspec(obj)
                    nargspec = inspect.getargspec(nobj)
                except TypeError:
                    pass
                else:
                    compare_argspecs(argspec, nargspec, attr)
    finally:
        for db in (ndb, db):
            db.close()
            db.break_cycles()
    if missing:
        pc = (len(missing) / total)
        raise AssertionError(u'{0:.1%}    of    API    ({2}    attrs)    are    missing:    {1}'.format(pc, u',    '.join(missing), len(missing)))
