mirror of
https://github.com/caronc/apprise.git
synced 2025-12-18 10:14:03 +08:00
Windows notification support; refs #14
This commit is contained in:
@@ -292,8 +292,8 @@ def test_apprise_asset(tmpdir):
|
||||
|
||||
a = AppriseAsset(
|
||||
theme='dark',
|
||||
image_path_mask='/{THEME}/{TYPE}-{XY}.png',
|
||||
image_url_mask='http://localhost/{THEME}/{TYPE}-{XY}.png',
|
||||
image_path_mask='/{THEME}/{TYPE}-{XY}{EXTENSION}',
|
||||
image_url_mask='http://localhost/{THEME}/{TYPE}-{XY}{EXTENSION}',
|
||||
)
|
||||
|
||||
a.default_html_color = '#abcabc'
|
||||
@@ -430,3 +430,32 @@ def test_apprise_asset(tmpdir):
|
||||
must_exist=False) is None)
|
||||
assert(a.image_path(NotifyType.INFO, NotifyImageSize.XY_256,
|
||||
must_exist=True) is None)
|
||||
|
||||
# Test our default extension out
|
||||
a = AppriseAsset(
|
||||
image_path_mask='/{THEME}/{TYPE}-{XY}{EXTENSION}',
|
||||
image_url_mask='http://localhost/{THEME}/{TYPE}-{XY}{EXTENSION}',
|
||||
default_extension='.jpeg',
|
||||
)
|
||||
assert(a.image_path(
|
||||
NotifyType.INFO,
|
||||
NotifyImageSize.XY_256,
|
||||
must_exist=False) == '/default/info-256x256.jpeg')
|
||||
|
||||
assert(a.image_url(
|
||||
NotifyType.INFO,
|
||||
NotifyImageSize.XY_256) == 'http://localhost/'
|
||||
'default/info-256x256.jpeg')
|
||||
|
||||
# extension support
|
||||
assert(a.image_path(
|
||||
NotifyType.INFO,
|
||||
NotifyImageSize.XY_128,
|
||||
must_exist=False,
|
||||
extension='.ico') == '/default/info-128x128.ico')
|
||||
|
||||
assert(a.image_url(
|
||||
NotifyType.INFO,
|
||||
NotifyImageSize.XY_256,
|
||||
extension='.test') == 'http://localhost/'
|
||||
'default/info-256x256.test')
|
||||
|
||||
Reference in New Issue
Block a user