<commit_before>#!/usr/bin/env python
import unittest
import boto.ec2.cloudwatch
import nagiosplugin
from mock import Mock
from check_enabled_alarms import DisabledAlarms


REGIONS = ['eu-west-1', 'us-east-1', 'sa-east-1']
AWS_ACCESS_KEY_ID = "ABC"
AWS_SECRET_ACCESS_KEY = "ABC"

MetricsMockTrue = Mock()
MetricsMockTrue.actions_enabled = 'true'

MetricsMockFalse = Mock()
MetricsMockFalse.actions_enabled = 'false'

ConnectionMock = Mock()
ConnectionMock.describe_alarms.return_value = [MetricsMockFalse, MetricsMockTrue, MetricsMockFalse]


class DisabledAlarmsTest(unittest.TestCase):
    def test_probe(self):
        boto.ec2.cloudwatch.connect_to_region = Mock(return_value=ConnectionMock)
        x = DisabledAlarms(REGIONS, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
        result = x.probe()
        self.assertEquals(result, nagiosplugin.Metric('disabledAlarms', 2 * len(REGIONS)))


if __name__ == '__main__':
    unittest.main()<commit_msg>Fixed Test<commit_after>#!/usr/bin/env python
import unittest
import boto.ec2.cloudwatch
import nagiosplugin
from mock import Mock
from check_enabled_alarms import DisabledAlarms


REGIONS = 'eu-west-1,us-east-1,sa-east-1'
AWS_ACCESS_KEY_ID = "ABC"
AWS_SECRET_ACCESS_KEY = "ABC"

MetricsMockTrue = Mock()
MetricsMockTrue.actions_enabled = 'true'

MetricsMockFalse = Mock()
MetricsMockFalse.actions_enabled = 'false'

ConnectionMock = Mock()
ConnectionMock.describe_alarms.return_value = [MetricsMockFalse, MetricsMockTrue, MetricsMockFalse]


class DisabledAlarmsTest(unittest.TestCase):
    def test_probe(self):
        boto.ec2.cloudwatch.connect_to_region = Mock(return_value=ConnectionMock)
        x = DisabledAlarms(REGIONS, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
        result = x.probe()
        self.assertEquals(result, nagiosplugin.Metric('disabledAlarms', 2 * 3))


if __name__ == '__main__':
    unittest.main()
{'fraction_non_alphanumeric': 0.10319148936170212, 'fraction_numerical': 0.006914893617021276, 'mean_word_length': 5.576923076923077, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6464944', 'n_tokens_mistral': 640, 'n_tokens_neox': 626, 'n_words': 114}