本文整理汇总了Python中galicaster.core.conf.Conf.update方法的典型用法代码示例。如果您正苦于以下问题:Python Conf.update方法的具体用法?Python Conf.update怎么用?Python Conf.update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类galicaster.core.conf.Conf
的用法示例。
在下文中一共展示了Conf.update方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TestFunctional
# 需要导入模块: from galicaster.core.conf import Conf [as 别名]
# 或者: from galicaster.core.conf.Conf import update [as 别名]
class TestFunctional(TestCase):
def setUp(self):
""" Set up clear conf with a custom logger and repository folder.
"""
self.conf_path = '/etc/galicaster/conf.ini'
identifier = self.id().split('.')
identifier.reverse()
test_number = re.sub('\D','',identifier[0])
self.test_path = '/tmp/test{}'.format(test_number)
if os.path.exists(self.conf_path) and not os.path.exists('{}.old'.format(self.conf_path)):
os.rename(self.conf_path,'{}.old'.format(self.conf_path))
shutil.copyfile(get_resource('conf/functional_test.ini'),'/etc/galicaster/conf.ini')
if not os.path.exists(self.test_path):
os.makedirs('{}/logs/'.format(self.test_path))
self.conf = Conf()
self.conf.set('basic','repository','{}/Repository'.format(self.test_path))
self.conf.set('logger','path','{}/logs/galicaster.log'.format(self.test_path))
self.conf.update()
config.load({'logDir':'{}/logs/'.format(self.test_path)})
from . import recording
def tearDown(self):
os.rename(self.conf_path,'{}/conf.ini'.format(self.test_path))
if os.path.exists('{}.old'.format(self.conf_path)):
os.rename('{}.old'.format(self.conf_path),self.conf_path)
recording.quit()
del self.conf
def test_136(self):
""" Do 15 recordings of 10 minutes of duration
with automatic ingest to Opencast
"""
self.conf.set('ingest','manual','immediately')
self.conf.set('ingest','active','true')
self.conf.update()
recording.start_galicaster()
recording.rec(10*60, 15)
def test_137(self):
""" Check nightly ingest while recording is paused
"""
self.conf.set('ingest','manual','nightly')
self.conf.set('ingest','active','true')
night = datetime.datetime.now() + datetime.timedelta(minutes=1)
self.conf.set('heartbeat','night',night.strftime('%H:%M'))
self.conf.update()
recording.start_galicaster()
recording.rec(5)
recording.go_to_recorder()
recording.start_recording()
recording.pause_recording()
remaining_sleep = night - datetime.datetime.now()
time.sleep(remaining_sleep.seconds)
recording.rewind_recording()
recording.stop_recording()
recording.go_to_distrib()