def test_get_aggregate_data_calls_post_with_expected_url_and_data( self, mock_connection, user_context): alert_service = AlertService(mock_connection, user_context) alert_service.get_aggregate_data("alert-id") assert (mock_connection.post.call_args[0][0] == "/svc/api/v2/query-details-aggregate") post_data = mock_connection.post.call_args[1]["json"] assert post_data["alertId"] == "alert-id"
def test_get_aggregate_data_creates_alias_for_ffs_url( self, mocker, mock_connection, user_context): # This is to support the method when it once called the v1 api. mock_connection.post.return_value = create_mock_response( mocker, TEST_ALERT_AGGREGATE_RESPONSE) alert_service = AlertService(mock_connection, user_context) response = alert_service.get_aggregate_data("alert-id") assert (response["alert"]["ffsUrl"] == "https://ffs-url-test.example.com" == response["alert"]["ffsUrlEndpoint"])