class_docstr: Tests for rule_promotion/publisher.py:StatsPublisher
class_docstr_tok: ["Tests","for","rule_promotion\/publisher.py",":","StatsPublisher"]
docstr: Helper function to return fake StagingStatistics
docstr_tok: ["Helper","function","to","return","fake","StagingStatistics"]
code: def _get_fake_stats(count=2):
      """Helper function to return fake StagingStatistics"""
      stage_time = datetime(
          year=2000, month=1, day=1, hour=1, minute=1, second=1
      )
      for i in range(count):
          stat = StagingStatistic(
              staged_at=stage_time,
              staged_until=stage_time + timedelta(days=2),
              current_time=stage_time + timedelta(days=1),
              rule="test_rule_{}".format(i),
          )
          stat.alert_count = i + 1
          yield stat
  
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 2 for calling the TestStatsPublisher obj's underlying member method code with example usage: obj._get_fake_stats(count) without return types