コード例 #1
0
ファイル: datetime.py プロジェクト: lilnana00/3ddd
 def get_value(self, client_context, value=None):
     del value
     formatter = DateFormatter()
     return formatter.time_representation()
コード例 #2
0
 def test_tomorrow(self):
     response = self._client_context.bot.ask_question(
         self._client_context, "TOMORROW")
     self.assertIsNotNone(response)
     self.date = DateFormatter(days=1)
     self.assertEqual(response, self.date.full_weekday() + ".")
コード例 #3
0
ファイル: datetime.py プロジェクト: darylfung96/program-y
 def get_value(self, bot, clientid, value=None):
     formatter = DateFormatter()
     return formatter.time_representation()
コード例 #4
0
 def setUp(self):
     DateTimeAIMLTests.test_client = BasicTestClient()
     self.date = DateFormatter()
コード例 #5
0
 def test_tomorrow(self):
     response = DateTimeAIMLTests.test_client.bot.ask_question(
         "test", "TOMORROW")
     self.assertIsNotNone(response)
     self.date = DateFormatter(days=1)
     self.assertEqual(response, self.date.full_weekday())
コード例 #6
0
 def setUp(self):
     DateTimeAIMLTests.test_client = BasicTestClient()
     DateTimeAIMLTests.test_client.bot.brain.dynamics.add_dynamic_set(
         'number', "programy.dynamic.sets.numeric.IsNumeric", None)
     self.date = DateFormatter()
コード例 #7
0
 def test_timezone_name(self):
     df = DateFormatter()
     self.assertIsNotNone(df)
     result = df.timezone_name()
     self.assertIsNotNone(result)
     self.assertEqual("", result)
コード例 #8
0
 def test_am_or_pm(self):
     df = DateFormatter()
     self.assertIsNotNone(df)
     result = df.am_or_pm()
     self.assertIsNotNone(result)
     self.assertRegex(r"[AM|PM]", result)
コード例 #9
0
 def test_time_representation(self):
     df = DateFormatter()
     self.assertIsNotNone(df)
     result = df.time_representation()
     self.assertIsNotNone(result)
     self.assertRegex(result, r"\d{2}:\d{2}:\d{2}")
コード例 #10
0
 def test_decimal_week_number_monday_as_first(self):
     df = DateFormatter()
     self.assertIsNotNone(df)
     result = df.decimal_week_number_monday_as_first()
     self.assertIsNotNone(result)
     self.assertRegex(result, "\d{1}|\d{2}")
コード例 #11
0
 def test_decimal_weekday(self):
     df = DateFormatter()
     self.assertIsNotNone(df)
     result = df.decimal_weekday()
     self.assertIsNotNone(result)
     self.assertRegex(result, "\d{1}|\d{2}")
コード例 #12
0
 def test_decimal_second(self):
     df = DateFormatter()
     self.assertIsNotNone(df)
     result = df.decimal_second()
     self.assertIsNotNone(result)
     self.assertRegex(result, r"\d{1}|\d{2}")
コード例 #13
0
 def test_hour_12_hour_clock(self):
     df = DateFormatter()
     self.assertIsNotNone(df)
     result = df.hour_12_hour_clock()
     self.assertIsNotNone(result)
     self.assertRegex(result, "\d{1}|\d{2}")
コード例 #14
0
 def test_locate_appropriate_date_time(self):
     df = DateFormatter()
     self.assertIsNotNone(df)
     result = df.locate_appropriate_date_time()
     self.assertIsNotNone(result)
     self.assertRegex(result, TextUtilsTests.DEFAULT_DATETIME_REGEX)
コード例 #15
0
 def test_abbreviated_weekday(self):
     df = DateFormatter()
     self.assertIsNotNone(df)
     result = df.abbreviated_weekday()
     self.assertIsNotNone(result)
     self.assertRegex(result, r"[Mon|Tue|Wed|Thu|Fri|Sat|Sun]")
コード例 #16
0
 def test_year_4_digit(self):
     df = DateFormatter()
     self.assertIsNotNone(df)
     result = df.year_4_digit()
     self.assertIsNotNone(result)
     self.assertRegex(result, r"\d{4}")
コード例 #17
0
 def test_full_weekday(self):
     df = DateFormatter()
     self.assertIsNotNone(df)
     result = df.full_weekday()
     self.assertIsNotNone(result)
     self.assertRegex(result, r"[Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday]")
コード例 #18
0
    def setUp(self):
        client = DateTimeAIMLTestClient()
        self._client_context = client.create_client_context("testid")

        self._client_context.brain.dynamics.add_dynamic_set('number', "programy.dynamic.sets.numeric.IsNumeric", None)
        self.date = DateFormatter()