mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-03-25 08:55:50 +00:00
Fix tests on OS X
This commit is contained in:
parent
5a257ec2cd
commit
db970981a0
1 changed files with 8 additions and 4 deletions
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
import json
|
||||
import unicodedata
|
||||
import sys
|
||||
from textwrap import dedent
|
||||
|
||||
import hypothesis.strategies as st
|
||||
|
|
@ -285,6 +286,7 @@ def test_multiple_pairs(tmpdir, runner):
|
|||
min_size=1
|
||||
))
|
||||
@example(collections=[u'persönlich'])
|
||||
@example(collections=set('aA'))
|
||||
def test_create_collections(subtest, collections):
|
||||
|
||||
@subtest
|
||||
|
|
@ -320,10 +322,12 @@ def test_create_collections(subtest, collections):
|
|||
#
|
||||
# Quoted from
|
||||
# https://stackoverflow.com/questions/18137554/how-to-convert-path-to-mac-os-x-path-the-almost-nfd-normal-form # noqa
|
||||
u = lambda xs: set(
|
||||
unicodedata.normalize('NFKD', x)
|
||||
for x in xs
|
||||
)
|
||||
def u(xs):
|
||||
xs = (unicodedata.normalize('NFKD', x) for x in xs)
|
||||
if sys.platform == 'darwin':
|
||||
xs = (x.lower() for x in xs)
|
||||
return set(xs)
|
||||
|
||||
assert u(x.basename for x in tmpdir.join('foo').listdir()) == \
|
||||
u(x.basename for x in tmpdir.join('bar').listdir()) == \
|
||||
u(collections)
|
||||
|
|
|
|||
Loading…
Reference in a new issue