コード例 #1
0
    def test_fuzzy_time_during_the_last_half_hour_ten_resolution(self, hour, minutes, resolution):
        result = to_fuzzy_time(hour, minutes, resolution)

        expected_hour = _convert_hour_to_word(_increment_hour(hour))
        expected_minute = _convert_minute_to_word(minutes, resolution)

        self.assertIsNotNone(result)
        self.assertEquals(result, " ".join([expected_minute, "till", expected_hour]))
コード例 #2
0
    def test_fuzzy_time_during_the_first_half_hour_fifteen_resolution(self, hour, minutes, resolution):
        result = to_fuzzy_time(hour, minutes, resolution)

        expected_hour = _convert_hour_to_word(hour)
        expected_minute = _convert_minute_to_word(minutes, resolution)

        self.assertIsNotNone(result)
        self.assertEquals(result, " ".join([expected_minute, "past", expected_hour]))
コード例 #3
0
    def test_convert_hour_to_word(self, hour):
        result = _convert_hour_to_word(hour)

        self.assertIsNotNone(result)
        self.assertIn(hour, EXPECTED_HOURS_WORDS[result])