当前位置: 首页>>代码示例>>Python>>正文


Python Grandad.label方法代码示例

本文整理汇总了Python中baklabel.Grandad.label方法的典型用法代码示例。如果您正苦于以下问题:Python Grandad.label方法的具体用法?Python Grandad.label怎么用?Python Grandad.label使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在baklabel.Grandad的用法示例。


在下文中一共展示了Grandad.label方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_confirm_number_subtracts_from_today

# 需要导入模块: from baklabel import Grandad [as 别名]
# 或者: from baklabel.Grandad import label [as 别名]
 def test_confirm_number_subtracts_from_today(self):
     """ 49 """
     dday = " -1 "
     tsto = Grandad(dday)
     result = tsto.label()
     expday = date.fromordinal(date.today().toordinal() - 1)
     expobj = Grandad(expday)
     expected = expobj.label()
     self.assertEqual(result, expected)
开发者ID:mdewhirst,项目名称:baklabel,代码行数:11,代码来源:test_baklabel.py

示例2: test_confirm_number_adds_to_today

# 需要导入模块: from baklabel import Grandad [as 别名]
# 或者: from baklabel.Grandad import label [as 别名]
 def test_confirm_number_adds_to_today(self):
     """ 50 """
     dday = " +3 "
     tsto = Grandad(dday)
     result = tsto.label()
     expday = date.fromordinal(date.today().toordinal() + 3)
     expobj = Grandad(expday)
     expected = expobj.label()
     self.assertEqual(result, expected)
开发者ID:mdewhirst,项目名称:baklabel,代码行数:11,代码来源:test_baklabel.py

示例3: test_confirm_blank_eq_today

# 需要导入模块: from baklabel import Grandad [as 别名]
# 或者: from baklabel.Grandad import label [as 别名]
 def test_confirm_blank_eq_today(self):
     """ 51 """
     dday = ''
     tsto = Grandad(dday)
     result = tsto.label()
     expday = date.fromordinal(date.today().toordinal())
     expobj = Grandad(expday)
     expected = expobj.label()
     self.assertEqual(result, expected)
开发者ID:mdewhirst,项目名称:baklabel,代码行数:11,代码来源:test_baklabel.py

示例4: test_2040313_time_trigger_early

# 需要导入模块: from baklabel import Grandad [as 别名]
# 或者: from baklabel.Grandad import label [as 别名]
 def test_2040313_time_trigger_early(self):
     """ 53 """
     dday = date(2040, 3, 13)
     expected = 'tue'
     # note this must be run after 02:00 to succeed
     tsto = Grandad(dday, smallhours=2)
     result = tsto.label()
     self.assertEqual(result, expected)
     # now prove dday is Tuesday
     tsto = Grandad(dday)
     result = tsto.label()
     self.assertEqual(result, expected)
开发者ID:mdewhirst,项目名称:baklabel,代码行数:14,代码来源:test_baklabel.py

示例5: test_2040313_time_trigger_late

# 需要导入模块: from baklabel import Grandad [as 别名]
# 或者: from baklabel.Grandad import label [as 别名]
 def test_2040313_time_trigger_late(self):
     """ 54 """
     dday = date(2040, 3, 13)
     expected = 'mon'
     # note this must be run before 23:00 to succeed
     tsto = Grandad(dday, smallhours=23)
     result = tsto.label()
     self.assertEqual(result, expected)
     # now prove dday is Tuesday
     expected = 'tue'
     tsto = Grandad(dday)
     result = tsto.label()
     self.assertEqual(result, expected)
开发者ID:mdewhirst,项目名称:baklabel,代码行数:15,代码来源:test_baklabel.py

示例6: test_3rd_friday

# 需要导入模块: from baklabel import Grandad [as 别名]
# 或者: from baklabel.Grandad import label [as 别名]
 def test_3rd_friday(self):
     """ 3 """
     dday = date(2010, 3, 19)
     expected = 'fri_3'
     tsto = Grandad(dday)
     result = tsto.label()
     self.assertEqual(result, expected)
开发者ID:mdewhirst,项目名称:baklabel,代码行数:9,代码来源:test_baklabel.py

示例7: test_1st_friday

# 需要导入模块: from baklabel import Grandad [as 别名]
# 或者: from baklabel.Grandad import label [as 别名]
 def test_1st_friday(self):
     """ 5 """
     dday = date(2040, 3, 2)
     expected = 'fri_1'
     tsto = Grandad(dday)
     result = tsto.label()
     self.assertEqual(result, expected)
开发者ID:mdewhirst,项目名称:baklabel,代码行数:9,代码来源:test_baklabel.py

示例8: test_forced_eoy

# 需要导入模块: from baklabel import Grandad [as 别名]
# 或者: from baklabel.Grandad import label [as 别名]
 def test_forced_eoy(self):
     """ 7 """
     dday = date(2040, 12, 31)
     expected = 'eoy_2040'
     tsto = Grandad(dday, eoy_label='eoy')
     result = tsto.label()
     self.assertEqual(result, expected)
开发者ID:mdewhirst,项目名称:baklabel,代码行数:9,代码来源:test_baklabel.py

示例9: test_monthend_feb_leap_year

# 需要导入模块: from baklabel import Grandad [as 别名]
# 或者: from baklabel.Grandad import label [as 别名]
 def test_monthend_feb_leap_year(self):
     """ 9 """
     dday = date(2040, 2, 29)
     expected = 'feb'
     tsto = Grandad(dday)
     result = tsto.label()
     self.assertEqual(result, expected)
开发者ID:mdewhirst,项目名称:baklabel,代码行数:9,代码来源:test_baklabel.py

示例10: test_new_year_day

# 需要导入模块: from baklabel import Grandad [as 别名]
# 或者: from baklabel.Grandad import label [as 别名]
 def test_new_year_day(self):
     """ 11 """
     dday = date(2040, 1, 1)
     expected = 'sun'
     tsto = Grandad(dday)
     result = tsto.label()
     self.assertEqual(result, expected)
开发者ID:mdewhirst,项目名称:baklabel,代码行数:9,代码来源:test_baklabel.py

示例11: test_force_sat_weekly_day

# 需要导入模块: from baklabel import Grandad [as 别名]
# 或者: from baklabel.Grandad import label [as 别名]
 def test_force_sat_weekly_day(self):
     """ 13 """
     dday = date(2040, 3, 24)
     expected = 'sat_4'
     tsto = Grandad(dday, weekly_day=5)
     result = tsto.label()
     self.assertEqual(result, expected)
开发者ID:mdewhirst,项目名称:baklabel,代码行数:9,代码来源:test_baklabel.py

示例12: test_default_eoy_a

# 需要导入模块: from baklabel import Grandad [as 别名]
# 或者: from baklabel.Grandad import label [as 别名]
 def test_default_eoy_a(self):
     """ 32 """
     dday = date(2040, 12, 31)
     expected = 'a_dec_2040'
     tsto = Grandad(dday, server_name='a')
     result = tsto.label()
     self.assertEqual(result, expected)
开发者ID:mdewhirst,项目名称:baklabel,代码行数:9,代码来源:test_baklabel.py

示例13: test_monthend_feb_leap_year_a

# 需要导入模块: from baklabel import Grandad [as 别名]
# 或者: from baklabel.Grandad import label [as 别名]
 def test_monthend_feb_leap_year_a(self):
     """ 33 """
     dday = date(2040, 2, 29)
     expected = 'a_feb'
     tsto = Grandad(dday, server_name='a')
     result = tsto.label()
     self.assertEqual(result, expected)
开发者ID:mdewhirst,项目名称:baklabel,代码行数:9,代码来源:test_baklabel.py

示例14: test_monthend_feb_a

# 需要导入模块: from baklabel import Grandad [as 别名]
# 或者: from baklabel.Grandad import label [as 别名]
 def test_monthend_feb_a(self):
     """ 34 """
     dday = date(2040, 2, 28)
     expected = 'a_tue'
     tsto = Grandad(dday, server_name='a')
     result = tsto.label()
     self.assertEqual(result, expected)
开发者ID:mdewhirst,项目名称:baklabel,代码行数:9,代码来源:test_baklabel.py

示例15: test_new_year_day_a

# 需要导入模块: from baklabel import Grandad [as 别名]
# 或者: from baklabel.Grandad import label [as 别名]
 def test_new_year_day_a(self):
     """ 35 """
     dday = date(2040, 1, 1)
     expected = 'a_sun'
     tsto = Grandad(dday, server_name='a')
     result = tsto.label()
     self.assertEqual(result, expected)
开发者ID:mdewhirst,项目名称:baklabel,代码行数:9,代码来源:test_baklabel.py


注:本文中的baklabel.Grandad.label方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。