mirror of
https://github.com/caronc/apprise.git
synced 2025-02-07 22:10:04 +01:00
pep8 fixes
This commit is contained in:
parent
8d1b67aebb
commit
dbab994f37
@ -291,7 +291,7 @@ class NotifyEmail(NotifyBase):
|
|||||||
|
|
||||||
finally:
|
finally:
|
||||||
# Gracefully terminate the connection with the server
|
# 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()
|
socket.quit()
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
@ -72,11 +72,9 @@ def test_apprise_cli():
|
|||||||
assert result.exit_code == 0
|
assert result.exit_code == 0
|
||||||
|
|
||||||
result = runner.invoke(cli.main, [
|
result = runner.invoke(cli.main, [
|
||||||
'-t', 'test title',
|
'-t', 'test title',
|
||||||
'good://localhost',
|
'good://localhost',
|
||||||
],
|
], input='test stdin body\n')
|
||||||
input='test stdin body\n',
|
|
||||||
)
|
|
||||||
assert result.exit_code == 0
|
assert result.exit_code == 0
|
||||||
|
|
||||||
result = runner.invoke(cli.main, [
|
result = runner.invoke(cli.main, [
|
||||||
|
@ -291,6 +291,7 @@ def test_webbase_lookup(mock_smtp):
|
|||||||
assert obj.port == 123
|
assert obj.port == 123
|
||||||
assert obj.smtp_host == 'smtp.l2g.com'
|
assert obj.smtp_host == 'smtp.l2g.com'
|
||||||
|
|
||||||
|
|
||||||
@mock.patch('smtplib.SMTP')
|
@mock.patch('smtplib.SMTP')
|
||||||
def test_smtplib_init_fail(mock_smtplib):
|
def test_smtplib_init_fail(mock_smtplib):
|
||||||
"""
|
"""
|
||||||
@ -323,6 +324,11 @@ def test_smtplib_init_fail(mock_smtplib):
|
|||||||
# Un-Expected
|
# Un-Expected
|
||||||
assert False
|
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')
|
@mock.patch('smtplib.SMTP')
|
||||||
def test_smtplib_send_okay(mock_smtplib):
|
def test_smtplib_send_okay(mock_smtplib):
|
||||||
|
Loading…
Reference in New Issue
Block a user