'If an interval is passed to reporter.run(), the reporter will run all watchers in the interval
along with their auditors. It will also reaudit all existing items of watchers that are not in
the interval but are dependent on watchers/auditors in the interval. This is done because any
changes to the dependencies could change the audit results even is the items have not changed.
In this case, index1 and index2 are in the interval and index3 is dependent on index1 auditor.
Expected result:
Watchers of index1 and index2 are run
New items of index1 and index2 are audited
Items of index3 are reaudited'

@patch('security_monkey.alerter.Alerter.report', new=mock_report)
def test_run_with_interval_auditor_dependencies(self):

    from security_monkey.reporter import Reporter
    build_mock_result(watcher_configs, auditor_configs_with_auditor_dependencies)
    reporter = Reporter(account='TEST_ACCOUNT')
    reporter.run('TEST_ACCOUNT', 15)
    watcher_keys = RUNTIME_WATCHERS.keys()
    self.assertEqual(first=2, second=len(watcher_keys), msg='Should    run    2    watchers    but    ran    {}'.format(len(watcher_keys)))
    self.assertTrue(('index1' in watcher_keys), msg='Watcher    index1    not    run')
    self.assertTrue(('index2' in watcher_keys), msg='Watcher    index2    not    run')
    self.assertEqual(first=1, second=len(RUNTIME_WATCHERS['index1']), msg='Watcher    index1    should    run    once    but    ran    {}    times'.format(len(RUNTIME_WATCHERS['index1'])))
    self.assertEqual(first=1, second=len(RUNTIME_WATCHERS['index2']), msg='Watcher    index2    should    run    once    but    ran    {}    times'.format(len(RUNTIME_WATCHERS['index2'])))
    auditor_keys = RUNTIME_AUDIT_COUNTS.keys()
    self.assertEqual(first=3, second=len(auditor_keys), msg='Should    run    3    auditors    but    ran    {}'.format(len(auditor_keys)))
    self.assertTrue(('index1' in auditor_keys), msg='Auditor    index1    not    run')
    self.assertTrue(('index2' in auditor_keys), msg='Auditor    index2    not    run')
    self.assertTrue(('index3' in auditor_keys), msg='Auditor    index3    not    run')
    self.assertEqual(first=1, second=RUNTIME_AUDIT_COUNTS['index1'], msg='Auditor    index1    should    have    audited    1    item    but    audited    {}'.format(RUNTIME_AUDIT_COUNTS['index1']))
    self.assertEqual(first=1, second=RUNTIME_AUDIT_COUNTS['index2'], msg='Auditor    index2    should    have    audited    1    item    but    audited    {}'.format(RUNTIME_AUDIT_COUNTS['index2']))
    self.assertEqual(first=1, second=RUNTIME_AUDIT_COUNTS['index3'], msg='Auditor    index3    should    have    audited    1    item    but    audited    {}'.format(RUNTIME_AUDIT_COUNTS['index3']))
