mirror of
https://github.com/caronc/apprise.git
synced 2025-01-31 18:39:16 +01:00
pep8 fixes
This commit is contained in:
parent
8d1b67aebb
commit
dbab994f37
@ -291,7 +291,7 @@ class NotifyEmail(NotifyBase):
|
||||
|
||||
finally:
|
||||
# Gracefully terminate the connection with the server
|
||||
if socket is not None: # pragma: no branch
|
||||
if socket is not None: # pragma: no branch
|
||||
socket.quit()
|
||||
|
||||
return True
|
||||
|
@ -72,11 +72,9 @@ def test_apprise_cli():
|
||||
assert result.exit_code == 0
|
||||
|
||||
result = runner.invoke(cli.main, [
|
||||
'-t', 'test title',
|
||||
'good://localhost',
|
||||
],
|
||||
input='test stdin body\n',
|
||||
)
|
||||
'-t', 'test title',
|
||||
'good://localhost',
|
||||
], input='test stdin body\n')
|
||||
assert result.exit_code == 0
|
||||
|
||||
result = runner.invoke(cli.main, [
|
||||
|
@ -291,6 +291,7 @@ def test_webbase_lookup(mock_smtp):
|
||||
assert obj.port == 123
|
||||
assert obj.smtp_host == 'smtp.l2g.com'
|
||||
|
||||
|
||||
@mock.patch('smtplib.SMTP')
|
||||
def test_smtplib_init_fail(mock_smtplib):
|
||||
"""
|
||||
@ -323,6 +324,11 @@ def test_smtplib_init_fail(mock_smtplib):
|
||||
# Un-Expected
|
||||
assert False
|
||||
|
||||
# A handled and expected exception
|
||||
mock_smtplib.side_effect = smtplib.SMTPException('Test')
|
||||
assert obj.notify(title='test', body='body',
|
||||
notify_type=NotifyType.INFO) is False
|
||||
|
||||
|
||||
@mock.patch('smtplib.SMTP')
|
||||
def test_smtplib_send_okay(mock_smtplib):
|
||||
|
Loading…
Reference in New Issue
Block a user