Fixed failing tests on Windows.

This commit is contained in:
Virgil Dupras 2011-09-29 19:23:35 +01:00
parent 75f0ed14aa
commit 26e496a051
2 changed files with 5 additions and 2 deletions

View File

@ -316,7 +316,9 @@ class Results(Markable):
try:
do_write(outfile)
except IOError as e:
if e.errno == 21: # outfile is a directory
# If our IOError is because dest is already a directory, we want to handle that. 21 is
# the code we get on OS X and Linux, 13 is what we get on Windows.
if e.errno in {21, 13}:
p = str(outfile)
dirname, basename = op.split(p)
otherfiles = os.listdir(dirname)

View File

@ -6,6 +6,7 @@
# which should be included with this package. The terms are also available at
# http://www.hardcoded.net/licenses/bsd_license
import os.path as op
from itertools import combinations
from .base import TestApp, NamedObject, with_app, eq_
@ -156,7 +157,7 @@ def app_with_subfolders():
def test_folder_crit_is_sorted(app):
# Folder subcriteria are sorted.
app.select_pri_criterion("Folder")
eq_(app.pdialog.criteria_list[:], ['baz', 'foo', 'foo/bar'])
eq_(app.pdialog.criteria_list[:], ['baz', 'foo', op.join('foo', 'bar')])
@with_app(app_with_subfolders)
def test_folder_crit_includes_subfolders(app):