mirror of
https://github.com/caronc/apprise.git
synced 2025-08-10 00:38:02 +02:00
Refactored base64 attachment handling (#1191)
This commit is contained in:
@ -30,6 +30,7 @@ import re
|
||||
import urllib
|
||||
import pytest
|
||||
|
||||
from apprise import exception
|
||||
from apprise.attachment.base import AttachBase
|
||||
from apprise.attachment.memory import AttachMemory
|
||||
from apprise import AppriseAttachment
|
||||
@ -203,3 +204,12 @@ def test_attach_memory():
|
||||
# Test hosted configuration and that we can't add a valid memory file
|
||||
aa = AppriseAttachment(location=ContentLocation.HOSTED)
|
||||
assert aa.add(response) is False
|
||||
|
||||
# now test our base64 output
|
||||
assert isinstance(response.base64(), str)
|
||||
# No encoding if we choose
|
||||
assert isinstance(response.base64(encoding=None), bytes)
|
||||
|
||||
response.invalidate()
|
||||
with pytest.raises(exception.AppriseFileNotFound):
|
||||
response.base64()
|
||||
|
Reference in New Issue
Block a user