def test_check_snstopicpolicy_empty(self): auditor = SNSAuditor(accounts=['TEST_ACCOUNT']) item = SNSItem(config=dict()) auditor.check_snstopicpolicy_empty(item) self.assertEqual(len(item.audit_issues), 1) self.assertEqual(item.audit_issues[0].score, 1)
def test_check_snstopicpolicy_empty(self): auditor = SNSAuditor(accounts=['TEST_ACCOUNT']) item = SNSItem(config=dict()) auditor.check_snstopicpolicy_empty(item) self.assertEquals(len(item.audit_issues), 1) self.assertEquals(item.audit_issues[0].score, 1)
def test_empty_snstopicpolicy(self): au = SNSAuditor(debug=True) obj = SNSItem(region='test-region', account='test-account', name='test-name', config={'policy': {}}) au.check_snstopicpolicy_empty(obj) self.assertEquals(len(obj.audit_issues), 1) if len(obj.audit_issues) == 1: for issue in obj.audit_issues: self.assertEquals(issue.score, 1) self.assertEquals(issue.issue, "SNS Topic Policy is empty") self.assertIsNone(issue.notes)
def test_empty_snstopicpolicy(self): au = SNSAuditor(debug=True) obj = SNSItem(region='test-region', account='test-account', name='test-name', config={'SNSPolicy': {}}) au.check_snstopicpolicy_empty(obj) self.assertEquals(len(obj.audit_issues), 1) if len(obj.audit_issues) == 1: for issue in obj.audit_issues: self.assertEquals(issue.score, 1) self.assertEquals(issue.issue, "SNS Topic Policy is empty") self.assertIsNone(issue.notes)