<commit_before>import unittest
from aviation_weather import Temperature
from aviation_weather.exceptions import TemperatureDecodeException


class TestTemperature(unittest.TestCase):
    """Unit tests for aviation_weather.components.temperature.Temperature"""

    def test_valid(self):
        """Test valid temperatures"""

        s = "21/12"
        o = Temperature(s)
        self.assertEqual(s, str(o))
        self.assertEqual(o.temperature, 21)
        self.assertEqual(o.dew_point, 12)

        s = "21/M12"
        o = Temperature(s)
        self.assertEqual(s, str(o))
        self.assertEqual(o.temperature, 21)
        self.assertEqual(o.dew_point, -12)

        s = "M01/M04"
        o = Temperature(s)
        self.assertEqual(s, str(o))
        self.assertEqual(o.temperature, -1)
        self.assertEqual(o.dew_point, -4)

    def test_invalid(self):
        """Test invalid temperatures"""

        tests = [
            "M/M",
            "1200",
            "////"
        ]
        for test in tests:
            with self.assertRaises(TemperatureDecodeException):
                Temperature(test)


if __name__ == "__main__":
    unittest.main()<commit_msg>refactored Temperature tests<commit_after>import unittest
from aviation_weather import Temperature
from aviation_weather.exceptions import TemperatureDecodeException


class TestTemperature(unittest.TestCase):
    """Unit tests for aviation_weather.components.temperature.Temperature"""

    def test_valid(self):
        """Test valid temperatures"""

        tests = [
            ("21/12", 21, 12),
            ("21/M12", 21, -12),
            ("M01/M04", -1, -4)
        ]
        for test in tests:
            t = Temperature(test[0])
            self.assertEqual(test[0], str(t))
            self.assertEqual(test[1], t.temperature)
            self.assertEqual(test[2], t.dew_point)

    def test_invalid(self):
        """Test invalid temperatures"""

        tests = [
            "M/M",
            "1200",
            "////"
        ]
        for test in tests:
            with self.assertRaises(TemperatureDecodeException):
                Temperature(test)


if __name__ == "__main__":
    unittest.main()
{'fraction_non_alphanumeric': 0.11863636363636364, 'fraction_numerical': 0.025454545454545455, 'mean_word_length': 2.166906474820144, 'pattern_counts': {'":': 2, '<': 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': '1440701', 'n_tokens_mistral': 698, 'n_tokens_neox': 613, 'n_words': 133}