Skip to content

Commit

Permalink
updates variable name for new api changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor Fonseca committed Nov 8, 2016
1 parent 89dd87a commit 87eadc2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions tests/test_zeus_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,11 @@ def test_create_alert(self, mock_requests):
metric_name = "cpu.value"
emails = "john1234@gmail.com"
status = "active"
frequency = 60
notify_period = 60

self.z.createAlert(alert_name, username, alerts_type,
alert_expression, alert_severity, metric_name,
emails, status, frequency)
emails, status, notify_period)
data = {
'alert_name': alert_name,
'username': username,
Expand All @@ -250,7 +250,7 @@ def test_create_alert(self, mock_requests):
'metric_name': metric_name,
'emails': emails,
'status': status,
'frequency': frequency
'notify_period': notify_period
}

mock_requests.post.assert_called_with(
Expand All @@ -272,11 +272,11 @@ def test_modify_alert(self, mock_requests):
metric_name = "cpu.value"
emails = "john1234@gmail.com"
status = "active"
frequency = 60
notify_period = 60

self.z.modifyAlert(alert_id, alert_name, username, alerts_type,
alert_expression, alert_severity, metric_name,
emails, status, frequency)
emails, status, notify_period)
data = {
'alert_name': alert_name,
'username': username,
Expand All @@ -287,7 +287,7 @@ def test_modify_alert(self, mock_requests):
'metric_name': metric_name,
'emails': emails,
'status': status,
'frequency': frequency
'notify_period': notify_period
}

path = FAKE_SERVER + '/alerts/' + FAKE_TOKEN + '/' + str(alert_id)
Expand Down
12 changes: 6 additions & 6 deletions zeus/interfaces/alerts.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def __init__(self, user_token, rest_client):

def createAlert(
self, alert_name, username, alerts_type, alert_expression,
alert_severity, metric_name, emails, status, frequency
alert_severity, metric_name, emails, status, notify_period
):

"""Creates a new alert, returns status code of creation
Expand All @@ -40,7 +40,7 @@ def createAlert(
:param metric_name: metric associated with the alert
:param emails: emails to receive notification when the alert triggers
:param status: if the alert is active or disable
:param frequency: frequency in which the expression is checked
:param notify_period: frequency of notifications
:rtype: array
"""
Expand All @@ -55,7 +55,7 @@ def createAlert(
'metric_name': metric_name,
'emails': emails,
'status': status,
'frequency': frequency
'notify_period': notify_period
}
path = '/alerts/' + self.token
header = {'content-type': 'application/json'}
Expand All @@ -74,7 +74,7 @@ def getAlerts(self):
def modifyAlert(
self, alert_id, alert_name, username, alerts_type,
alert_expression, alert_severity, metric_name, emails, status,
frequency
notify_period
):

"""Modifies an existing alert with new data
Expand All @@ -89,7 +89,7 @@ def modifyAlert(
:param metric_name: metric associated with the alert
:param emails: emails to receive notification when the alert triggers
:param status: if the alert is active or disable
:param frequency: frequency in which the expression is checked
:param notify_period: frequency of notifications
:rtype: array
"""
Expand All @@ -104,7 +104,7 @@ def modifyAlert(
'metric_name': metric_name,
'emails': emails,
'status': status,
'frequency': frequency
'notify_period': notify_period
}
path = '/alerts/' + self.token + '/' + str(alert_id)
header = {'content-type': 'application/json'}
Expand Down

0 comments on commit 87eadc2

Please sign in to comment.