本文整理汇总了Python中clock.Clock.at方法的典型用法代码示例。如果您正苦于以下问题:Python Clock.at方法的具体用法?Python Clock.at怎么用?Python Clock.at使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类clock.Clock
的用法示例。
在下文中一共展示了Clock.at方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_on_the_hour
# 需要导入模块: from clock import Clock [as 别名]
# 或者: from clock.Clock import at [as 别名]
def test_on_the_hour(self):
self.assertEqual("08:00", Clock.at(8).__str__() )
self.assertEqual("09:00", Clock.at(9).__str__() )
示例2: test_past_the_hour
# 需要导入模块: from clock import Clock [as 别名]
# 或者: from clock.Clock import at [as 别名]
def test_past_the_hour(self):
self.assertEqual("11:09", Clock.at(11, 9).__str__() )
示例3: test_inequivalent_clocks
# 需要导入模块: from clock import Clock [as 别名]
# 或者: from clock.Clock import at [as 别名]
def test_inequivalent_clocks(self):
clock1 = Clock.at(15, 37)
clock2 = Clock.at(15, 36)
clock3 = Clock.at(14, 37)
self.assertNotEqual(clock1, clock2)
self.assertNotEqual(clock1, clock3)
示例4: test_wrap_around_backwards
# 需要导入模块: from clock import Clock [as 别名]
# 或者: from clock.Clock import at [as 别名]
def test_wrap_around_backwards(self):
clock = Clock.at(0, 30) - 60
self.assertEqual("23:30", clock.__str__())
示例5: test_equivalent_clocks
# 需要导入模块: from clock import Clock [as 别名]
# 或者: from clock.Clock import at [as 别名]
def test_equivalent_clocks(self):
clock1 = Clock.at(15, 37)
clock2 = Clock.at(15, 37)
self.assertEqual(clock1, clock2)
示例6: test_subtract_minutes
# 需要导入模块: from clock import Clock [as 别名]
# 或者: from clock.Clock import at [as 别名]
def test_subtract_minutes(self):
clock = Clock.at(10) - 90
self.assertEqual("08:30", clock.__str__())
示例7: test_wrap_around_at_midnight
# 需要导入模块: from clock import Clock [as 别名]
# 或者: from clock.Clock import at [as 别名]
def test_wrap_around_at_midnight(self):
clock = Clock.at(23, 30) + 60
self.assertEqual("00:30", clock.__str__())
示例8: test_add_over_an_hour
# 需要导入模块: from clock import Clock [as 别名]
# 或者: from clock.Clock import at [as 别名]
def test_add_over_an_hour(self):
clock = Clock.at(10) + 61
self.assertEqual("11:01", clock.__str__())
示例9: test_add_a_few_minutes
# 需要导入模块: from clock import Clock [as 别名]
# 或者: from clock.Clock import at [as 别名]
def test_add_a_few_minutes(self):
clock = Clock.at(10) + 3
self.assertEqual("10:03", clock.__str__())