mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-04-11 11:46:02 +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
|
||||
|
||||
|
||||
@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
|
||||
def test_repair_unsafe_uids(uid):
|
||||
if href_safe(uid):
|
||||
return
|
||||
|
||||
s = MemoryStorage()
|
||||
item = Item(u'BEGIN:VCARD\nUID:{}\nEND:VCARD'.format(uid))
|
||||
print(repr(item.raw))
|
||||
href, etag = s.upload(item)
|
||||
assert s.get(href)[0].uid == uid
|
||||
assert not href_safe(uid)
|
||||
|
||||
repair_storage(s)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue