# Path: webdiff/util.py
# class ImageMagickNotAvailableError(Exception):
# class ImageMagickError(Exception):
# def memoize(obj):
#     def memoizer(*args, **kwargs):
# def contentHash(path):
# def are_files_identical(path1, path2):
# def image_metadata(path):
# def is_imagemagick_available():
# def generate_pdiff_image(before_path, after_path):
# def generate_dilated_pdiff_image(diff_path):
# def get_pdiff_bbox(diff_path):
#     PIPE = subprocess.PIPE
# 
# Path: webdiff/diff.py
# def get_thin_dict(diff):
# def get_thick_dict(diff):
# def get_thin_list(diffs, thick_idx=None):
# def no_changes(diff):
# def is_image_diff(diff):
#     def is_image(path):
# def find_diff_index(diffs, side, path):
#     def norm(p):
# 
# Path: webdiff/dirdiff.py
# def diff(a_dir, b_dir):
# def find_diff(a, b):
#     def list_files(top_dir):
#     def safejoin(d, p):
# def pair_files(a_files, b_files):
# def find_moves(pairs):


import unittest
from nose.tools import *
from webdiff import util
from webdiff import diff
from webdiff import dirdiff
        'static/js/file_diff.js',
        'static/jsdifflib/diffview.css',
        'static/jsdifflib/diffview.js',
        'templates/heartbeat.html']

    b_files = [
        'app.py',
        'testing.cfg',
        'TODO',
        'static/js/file_diff.js',
        'static/jsdifflib/diffview.css',
        'static/jsdifflib/diffview.js',
        'templates/heartbeat.html']

    pairs = dirdiff.pair_files(a_files, b_files)
    pairs.sort()

    eq_(
        [('', 'testing.cfg'),
         ('TODO', 'TODO'),
         ('app.py', 'app.py'),
         ('static/js/file_diff.js', 'static/js/file_diff.js'),
         ('static/jsdifflib/diffview.css', 'static/jsdifflib/diffview.css'),
         ('static/jsdifflib/diffview.js', 'static/jsdifflib/diffview.js'),
         ('templates/heartbeat.html', 'templates/heartbeat.html'),
         ], pairs)


def test_pairing_with_move():
    testdir = 'testdata/renamedfile'

# Path: webdiff/util.py
# class ImageMagickNotAvailableError(Exception):
# class ImageMagickError(Exception):
# def memoize(obj):
#     def memoizer(*args, **kwargs):
# def contentHash(path):
# def are_files_identical(path1, path2):
# def image_metadata(path):
# def is_imagemagick_available():
# def generate_pdiff_image(before_path, after_path):
# def generate_dilated_pdiff_image(diff_path):
# def get_pdiff_bbox(diff_path):
#     PIPE = subprocess.PIPE
# 
# Path: webdiff/diff.py
# def get_thin_dict(diff):
# def get_thick_dict(diff):
# def get_thin_list(diffs, thick_idx=None):
# def no_changes(diff):
# def is_image_diff(diff):
#     def is_image(path):
# def find_diff_index(diffs, side, path):
#     def norm(p):
# 
# Path: webdiff/dirdiff.py
# def diff(a_dir, b_dir):
# def find_diff(a, b):
#     def list_files(top_dir):
#     def safejoin(d, p):
# def pair_files(a_files, b_files):
# def find_moves(pairs):


# Path: tests/pair_test.py
import unittest
from nose.tools import *
from webdiff import util
from webdiff import diff
from webdiff import dirdiff

        'static/js/file_diff.js',
        'static/jsdifflib/diffview.css',
        'static/jsdifflib/diffview.js',
        'templates/heartbeat.html']

    b_files = [
        'app.py',
        'testing.cfg',
        'TODO',
        'static/js/file_diff.js',
        'static/jsdifflib/diffview.css',
        'static/jsdifflib/diffview.js',
        'templates/heartbeat.html']

    pairs = dirdiff.pair_files(a_files, b_files)
    pairs.sort()

    eq_(
        [('', 'testing.cfg'),
         ('TODO', 'TODO'),
         ('app.py', 'app.py'),
         ('static/js/file_diff.js', 'static/js/file_diff.js'),
         ('static/jsdifflib/diffview.css', 'static/jsdifflib/diffview.css'),
         ('static/jsdifflib/diffview.js', 'static/jsdifflib/diffview.js'),
         ('templates/heartbeat.html', 'templates/heartbeat.html'),
         ], pairs)


def test_pairing_with_move():
    testdir = 'testdata/renamedfile'

    diffs = dirdiff.diff('%s/left/dir' % testdir, '%s/right/dir' % testdir)