mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-04-27 14:57:41 +00:00
Hypothesis: Use more idiomatic filter instead of return
This commit is contained in:
parent
54fa46ffae
commit
3eee5a55a1
1 changed files with 2 additions and 4 deletions
|
|
@ -40,17 +40,15 @@ def test_repair_uids(uid):
|
||||||
assert uid1 != uid2
|
assert uid1 != uid2
|
||||||
|
|
||||||
|
|
||||||
@given(uid=uid_strategy)
|
@given(uid=uid_strategy.filter(lambda x: not href_safe(x)))
|
||||||
@settings(perform_health_check=False) # Using the random module for UIDs
|
@settings(perform_health_check=False) # Using the random module for UIDs
|
||||||
def test_repair_unsafe_uids(uid):
|
def test_repair_unsafe_uids(uid):
|
||||||
if href_safe(uid):
|
|
||||||
return
|
|
||||||
|
|
||||||
s = MemoryStorage()
|
s = MemoryStorage()
|
||||||
item = Item(u'BEGIN:VCARD\nUID:{}\nEND:VCARD'.format(uid))
|
item = Item(u'BEGIN:VCARD\nUID:{}\nEND:VCARD'.format(uid))
|
||||||
print(repr(item.raw))
|
print(repr(item.raw))
|
||||||
href, etag = s.upload(item)
|
href, etag = s.upload(item)
|
||||||
assert s.get(href)[0].uid == uid
|
assert s.get(href)[0].uid == uid
|
||||||
|
assert not href_safe(uid)
|
||||||
|
|
||||||
repair_storage(s)
|
repair_storage(s)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue