Skip to content

Commit

Permalink
small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
m4droid committed May 14, 2017
1 parent 8f7fb87 commit d7583ac
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions fabfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,5 +158,5 @@ def uwsgi_stop():
)


def _dump_env_vars_uwsgi(vars):
return '\\n'.join('env = {0:s}={1:s}'.format(*var) for var in vars.items()).strip()
def _dump_env_vars_uwsgi(vars_):
return '\\n'.join('env = {0:s}={1:s}'.format(*var) for var in vars_.items()).strip()
3 changes: 1 addition & 2 deletions restriccion/libs/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ def load_env_params():
config_path = _get_config_path('env_{0:s}.json'.format(env))

if config_path is None:
print('ERROR: {0:s} environment config file not found'.format(env), file=sys.stderr)
return
raise Exception('ERROR: {0:s} environment config file not found'.format(env), file=sys.stderr)

with open(config_path) as f:
data = json.load(f)
Expand Down
2 changes: 1 addition & 1 deletion restriccion/libs/notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def send_to_email_addresses(emails_list, data):
try:
service.sendmail(email_from, email_to, msg.as_string())
sent_emails.append(email_to)
except:
except OSError:
pass
service.quit()

Expand Down
2 changes: 1 addition & 1 deletion tests/test_libs_notifications_email.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def test_libs_notifications_send_emails_ok(self, mock_smtp):
@patch('restriccion.libs.notifications.smtplib')
def test_libs_notifications_send_emails_error(self, mock_smtplib):
mock_class = Mock()
mock_class.sendmail = Mock(side_effect=Exception())
mock_class.sendmail = Mock(side_effect=OSError())
mock_smtplib.SMTP = lambda *a: mock_class

expected_emails = ["fake@email.com"]
Expand Down

0 comments on commit d7583ac

Please sign in to comment.