mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-04-27 14:57:41 +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 json
|
||||||
import unicodedata
|
import unicodedata
|
||||||
|
import sys
|
||||||
from textwrap import dedent
|
from textwrap import dedent
|
||||||
|
|
||||||
import hypothesis.strategies as st
|
import hypothesis.strategies as st
|
||||||
|
|
@ -285,6 +286,7 @@ def test_multiple_pairs(tmpdir, runner):
|
||||||
min_size=1
|
min_size=1
|
||||||
))
|
))
|
||||||
@example(collections=[u'persönlich'])
|
@example(collections=[u'persönlich'])
|
||||||
|
@example(collections=set('aA'))
|
||||||
def test_create_collections(subtest, collections):
|
def test_create_collections(subtest, collections):
|
||||||
|
|
||||||
@subtest
|
@subtest
|
||||||
|
|
@ -320,10 +322,12 @@ def test_create_collections(subtest, collections):
|
||||||
#
|
#
|
||||||
# Quoted from
|
# Quoted from
|
||||||
# https://stackoverflow.com/questions/18137554/how-to-convert-path-to-mac-os-x-path-the-almost-nfd-normal-form # noqa
|
# https://stackoverflow.com/questions/18137554/how-to-convert-path-to-mac-os-x-path-the-almost-nfd-normal-form # noqa
|
||||||
u = lambda xs: set(
|
def u(xs):
|
||||||
unicodedata.normalize('NFKD', x)
|
xs = (unicodedata.normalize('NFKD', x) for x in xs)
|
||||||
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()) == \
|
assert u(x.basename for x in tmpdir.join('foo').listdir()) == \
|
||||||
u(x.basename for x in tmpdir.join('bar').listdir()) == \
|
u(x.basename for x in tmpdir.join('bar').listdir()) == \
|
||||||
u(collections)
|
u(collections)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue