本文整理汇总了Python中OWDTestToolkit.apps.settings.Settings.set_alarm_volume方法的典型用法代码示例。如果您正苦于以下问题:Python Settings.set_alarm_volume方法的具体用法?Python Settings.set_alarm_volume怎么用?Python Settings.set_alarm_volume使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OWDTestToolkit.apps.settings.Settings
的用法示例。
在下文中一共展示了Settings.set_alarm_volume方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_main
# 需要导入模块: from OWDTestToolkit.apps.settings import Settings [as 别名]
# 或者: from OWDTestToolkit.apps.settings.Settings import set_alarm_volume [as 别名]
class test_main(GaiaTestCase):
def setUp(self):
# Set up child objects...
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.clock = Clock(self)
self.settings = Settings(self)
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
# Set the volume to be low (no need to wake up the office! ;o)
self.settings.set_alarm_volume(0)
# Launch clock app.
self.clock.launch()
# Delete all previous alarms.
#
self.clock.delete_all_alarms()
# Create an alarm that is 1 minute in the future.
# (Make sure we're not about to do this at the end of a minute or an hour.)
#
now_mins = time.strftime("%M", time.gmtime())
diff_m = 60 - int(now_mins)
if diff_m <= 1:
time.sleep(60)
now_secs = time.strftime("%S", time.gmtime())
diff_s = 60 - int(now_secs)
if diff_s <= 15:
time.sleep(diff_s)
t = datetime.datetime.now() + datetime.timedelta(minutes=1)
title = "Test alarm"
self.clock.create_alarm(t.hour, t.minute, title)
"""
Return to the main screen (since this is where the user will
most likely be when the alarm goes off).
"""
self.UTILS.home.goHome()
# Check the statusbar icon exists.
self.UTILS.test.test(self.clock.checkStatusbarIcon(), "Alarm icon is present in statusbar.")
# Wait for the alarm to start.
self.clock.checkAlarmRingDetails(t.hour, t.minute, title)