URL parameters preserved for attachment queries (#187)

This commit is contained in:
Chris Caron
2019-12-15 13:17:58 -05:00
committed by GitHub
parent d1a15978af
commit 408810d6b4
4 changed files with 130 additions and 22 deletions

View File

@ -78,14 +78,14 @@ def test_apprise_attachment():
assert aa
# Add another entry already in it's AttachBase format
response = AppriseAttachment.instantiate(path)
response = AppriseAttachment.instantiate(path, cache=True)
assert isinstance(response, AttachBase)
assert aa.add(response, asset=AppriseAsset())
# There is now 2 attachments
assert len(aa) == 2
# No cache set, so our cache defaults to True
# Cache is initialized to True
assert aa[1].cache is True
# Reset our object
@ -173,6 +173,10 @@ def test_apprise_attachment():
assert not aa.add(AppriseAttachment.instantiate(
'file://{}?name=andanother.png&cache=-600'.format(path)))
# Invalid cache value
assert not aa.add(AppriseAttachment.instantiate(
'file://{}?name=andanother.png'.format(path), cache='invalid'))
# No length change
assert len(aa) == 3