def get_value(self, client_context, value=None): del value formatter = DateFormatter() return formatter.time_representation()
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() + ".")
def get_value(self, bot, clientid, value=None): formatter = DateFormatter() return formatter.time_representation()
def setUp(self): DateTimeAIMLTests.test_client = BasicTestClient() self.date = DateFormatter()
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())
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()
def test_timezone_name(self): df = DateFormatter() self.assertIsNotNone(df) result = df.timezone_name() self.assertIsNotNone(result) self.assertEqual("", result)
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)
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}")
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}")
def test_decimal_weekday(self): df = DateFormatter() self.assertIsNotNone(df) result = df.decimal_weekday() self.assertIsNotNone(result) self.assertRegex(result, "\d{1}|\d{2}")
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}")
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}")
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)
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]")
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}")
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]")
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()