Skip to content

Commit

Permalink
code coverage cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
caronc committed Apr 15, 2022
1 parent 52b041c commit 44d54ac
Showing 1 changed file with 8 additions and 23 deletions.
31 changes: 8 additions & 23 deletions apprise/Apprise.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,27 +540,12 @@ def _notifyall(self, handler, body, title='', notify_type=NotifyType.INFO,
# was set to None), or we did define a tag and the logic above
# determined we need to notify the service it's associated with
if server.notify_format not in conversion_body_map:
try:
(conversion_title_map[server.notify_format],
conversion_body_map[server.notify_format]) = \
convert_between(
body_format, server.notify_format, body=body,
title=title)

except AttributeError:
# this occurs if a non-string was passed in
logger.error(
'An invalid message/title was provided to Apprise')
raise TypeError()

except UnicodeDecodeError:
# Python v2.7 will throw this if the string fed in isn't
# what is otherwise configured in Python. Users can
# over-ride this if they set the `encoding` option
logger.error(
'The content passed into Apprise was not of encoding '
'type: {}'.format(self.asset.encoding))
raise TypeError()
# Perform Conversion
(conversion_title_map[server.notify_format],
conversion_body_map[server.notify_format]) = \
convert_between(
body_format, server.notify_format, body=body,
title=title)

if interpret_escapes:
#
Expand Down Expand Up @@ -621,8 +606,8 @@ def _notifyall(self, handler, body, title='', notify_type=NotifyType.INFO,
raise TypeError()

if six.PY2:
# Python 2.7 strings must be encoded as utf-8 as Python 3
# ones if not already.
# Python 2.7 strings must be encoded as utf-8 for
# consistency across all platforms
if conversion_title_map[server.notify_format] and \
isinstance(
conversion_title_map[server.notify_format],
Expand Down

0 comments on commit 44d54ac

Please sign in to comment.