class_docstr: Tests for rule_promotion/publisher.py:StatsPublisher
class_docstr_tok: ["Tests","for","rule_promotion\/publisher.py",":","StatsPublisher"]
docstr: StatsPublisher - Query Alerts
docstr_tok: ["StatsPublisher","-","Query","Alerts"]
code: def test_query_alerts(self):
      """StatsPublisher - Query Alerts"""
      stat = list(self._get_fake_stats(count=1))[0]
      execution_id = "678cc350-d4e1-4296-86d5-9351b7f92ed4"
      with patch.object(
          self.publisher, "_athena_client", new_callable=PropertyMock
      ) as mock:
          mock.run_async_query.return_value = {
              "QueryExecutionId": execution_id
          }
          assert_equal(self.publisher._query_alerts(stat), execution_id)
  
file_path: streamalert/tests/unit/streamalert/rule_promotion/test_publisher.py
imports: from datetime import datetime, timedelta
  from mock import patch, PropertyMock
  from nose.tools import assert_equal, assert_raises
  from streamalert.rule_promotion.publisher import StatsPublisher
  from streamalert.rule_promotion.statistic import StagingStatistic
  from streamalert.shared import athena, config
label_desc: Use image node_id 9 for calling the TestStatsPublisher obj's underlying member method code with example usage: obj.test_query_alerts() without return types