# Path: webdiff/argparser.py
# class UsageError(Exception):
# USAGE = '''Usage: webdiff <left_dir> <right_dir>
#        webdiff <left_file> <right_file>
#        webdiff https://github.com/<owner>/<repo>/pull/<num>
# 
# Or run "git webdiff" from a git repository.
# '''
# PULL_REQUEST_RE = re.compile(
#     r'http[s]://(?:www.)?github.com/([^/]+)/([^/]+)/pull/([0-9]+)(?:/.*)?'
# )
# PULL_REQUEST_NUM_RE = re.compile(r'^#([0-9]+)$')
# def parse(args, version=None):
# def _shim_for_file_diff(a_file, b_file):
# def diff_for_args(args):


from webdiff import argparser
from nose.tools import *
import tempfile
import os


_, file1 = tempfile.mkstemp()
_, file2 = tempfile.mkstemp()
dir1 = tempfile.mkdtemp()
dir2 = tempfile.mkdtemp()

def test_file_dir_pairs():
    eq_({'files': (file1, file2)}, argparser.parse([file1, file2]))
    eq_({'dirs': (dir1, dir2)}, argparser.parse([dir1, dir2]))


# Path: webdiff/argparser.py
# class UsageError(Exception):
# USAGE = '''Usage: webdiff <left_dir> <right_dir>
#        webdiff <left_file> <right_file>
#        webdiff https://github.com/<owner>/<repo>/pull/<num>
# 
# Or run "git webdiff" from a git repository.
# '''
# PULL_REQUEST_RE = re.compile(
#     r'http[s]://(?:www.)?github.com/([^/]+)/([^/]+)/pull/([0-9]+)(?:/.*)?'
# )
# PULL_REQUEST_NUM_RE = re.compile(r'^#([0-9]+)$')
# def parse(args, version=None):
# def _shim_for_file_diff(a_file, b_file):
# def diff_for_args(args):


# Path: tests/argparser_test.py
from webdiff import argparser
from nose.tools import *
import tempfile
import os



_, file1 = tempfile.mkstemp()
_, file2 = tempfile.mkstemp()
dir1 = tempfile.mkdtemp()
dir2 = tempfile.mkdtemp()

def test_file_dir_pairs():
    eq_({'files': (file1, file2)}, argparser.parse([file1, file2]))
    eq_({'dirs': (dir1, dir2)}, argparser.parse([dir1, dir2]))


    with assert_raises(argparser.UsageError):