Skip to content

Commit

Permalink
updating tests to check for rollback of all funcs
Browse files Browse the repository at this point in the history
  • Loading branch information
ryandeivert committed Apr 2, 2020
1 parent 2909109 commit ac27927
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/unit/streamalert_cli/manage_lambda/test_rollback.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class MockOptions:

def __init__(self, clusters, function):
self.clusters = clusters
self.function = function
self.functions = function


@mock.patch.object(rollback, 'boto3', mock.MagicMock())
Expand Down Expand Up @@ -64,9 +64,13 @@ def test_rollback_production_error(self, mock_logger):
def test_rollback_all(self, mock_helper):
"""CLI - Lambda rollback all"""
mock_helper.return_value = True
funcs = [
'alert', 'alert_merger', 'apps', 'athena', 'classifier',
'rule', 'rule_promo', 'scheduled_queries', 'threat_intel_downloader'
]
assert_equal(
rollback.RollbackCommand.handler(
MockOptions(None, ['all']),
MockOptions(None, funcs),
MockCLIConfig(config=basic_streamalert_config())
),
True
Expand All @@ -80,6 +84,8 @@ def test_rollback_all(self, mock_helper):
mock.call(mock.ANY, 'unit-test_corp_streamalert_classifier'),
mock.call(mock.ANY, 'unit-test_prod_streamalert_classifier'),
mock.call(mock.ANY, 'unit-test_streamalert_rules_engine'),
mock.call(mock.ANY, 'unit-test_streamalert_rule_promotion'),
mock.call(mock.ANY, 'unit-test_streamalert_scheduled_queries_runner'),
mock.call(mock.ANY, 'unit-test_streamalert_threat_intel_downloader')
])

Expand Down

0 comments on commit ac27927

Please sign in to comment.