本文整理匯總了Python中release.updates.verify.UpdateVerifyConfig.write方法的典型用法代碼示例。如果您正苦於以下問題:Python UpdateVerifyConfig.write方法的具體用法?Python UpdateVerifyConfig.write怎麽用?Python UpdateVerifyConfig.write使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類release.updates.verify.UpdateVerifyConfig
的用法示例。
在下文中一共展示了UpdateVerifyConfig.write方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: len
# 需要導入模塊: from release.updates.verify import UpdateVerifyConfig [as 別名]
# 或者: from release.updates.verify.UpdateVerifyConfig import write [as 別名]
if v in partials:
# Full test for all locales
# "from" and "to" to be downloaded from the same staging
# server in dev environment
if len(locales) > 0:
log.info("Generating configs for partial update checks for %s" % v)
uvc.addRelease(release=appVersion, build_id=build_id,
locales=locales,
patch_types=['complete', 'partial'],
from_path=from_path, ftp_server_from=staging_server,
ftp_server_to=staging_server,
mar_channel_IDs=mar_channel_IDs)
else:
# Full test for limited locales
# "from" and "to" to be downloaded from different staging
# server in dev environment
if len(this_full_check_locales) > 0:
log.info("Generating full check configs for %s" % v)
uvc.addRelease(release=appVersion, build_id=build_id,
locales=this_full_check_locales, from_path=from_path,
ftp_server_from=previous_releases_staging_server,
ftp_server_to=staging_server,
mar_channel_IDs=mar_channel_IDs)
# Quick test for other locales, no download
if len(quick_check_locales) > 0:
log.info("Generating quick check configs for %s" % v)
uvc.addRelease(release=appVersion, build_id=build_id,
locales=quick_check_locales)
f = open(options.output, 'w')
uvc.write(f)
示例2: TestUpdateVerifyConfig
# 需要導入模塊: from release.updates.verify import UpdateVerifyConfig [as 別名]
# 或者: from release.updates.verify.UpdateVerifyConfig import write [as 別名]
#.........這裏部分代碼省略.........
locales=("af", "de", "en-US", "ja", "zh-TW"),
patch_types=("partial", "complete"),
from_path="/firefox/4.0rc1.tar.bz2",
ftp_server_from=ftp_server_from,
ftp_server_to=ftp_server_to,
mar_channel_IDs="firefox-mozilla-beta",
)
self.uvc.addRelease(
"4.0b12",
build_id="777",
platform="Linux_x86-gcc3",
locales=["af", "en-US"],
from_path="/firefox/4.0b12.tar.bz2",
ftp_server_from=ftp_server_from,
ftp_server_to=ftp_server_to,
)
self.uvc.addRelease(
"4.0b12",
build_id="777",
platform="Linux_x86-gcc3",
locales=("de", "ja", "zh-TW"),
ftp_server_from=ftp_server_from,
ftp_server_to=ftp_server_to,
)
self.uvc.addRelease(
"3.7a1",
build_id="666",
locales=("en-US",),
ftp_server_from=ftp_server_from,
ftp_server_to=ftp_server_to,
platform="Linux_x86-gcc3",
)
self.uvc.write(self.tmpfile)
self.tmpfile.close()
self.assertEquals(md5(open(self.config).read()).hexdigest(), md5(open(self.tmpfilename).read()).hexdigest())
def testReadInvalidKey(self):
invalidLine = 'foo="bar"'
self.assertRaises(UpdateVerifyError, self.uvc._parseLine, invalidLine)
def testReadDuplicateKey(self):
invalidLine = 'release="bar" release="blah"'
self.assertRaises(UpdateVerifyError, self.uvc._parseLine, invalidLine)
def testParseLineBad(self):
invalidLine = "abh nthntuehonhuh nhhueont hntueoh nthouo"
self.assertRaises(UpdateVerifyError, self.uvc._parseLine, invalidLine)
def testGetChunk(self):
ftp_server_from = "stage.mozilla.org/firefox"
ftp_server_to = "stage.mozilla.org/firefox"
self.uvc.read(self.config)
uvc2 = UpdateVerifyConfig()
uvc2.product = "Firefox"
uvc2.channel = "betatest"
uvc2.aus_server = "https://aus4.mozilla.org"
uvc2.to = "/firefox/4.0rc2.tar.bz2"
uvc2.addRelease(
"4.0",
build_id="888",
platform="Linux_x86-gcc3",
locales=["af", "de", "en-US"],
patch_types=["partial", "complete"],
from_path="/firefox/4.0rc1.tar.bz2",
ftp_server_from=ftp_server_from,
示例3: is_triangualar
# 需要導入模塊: from release.updates.verify import UpdateVerifyConfig [as 別名]
# 或者: from release.updates.verify.UpdateVerifyConfig import write [as 別名]
from_path=from_path,
ftp_server_from=prev_archive_prefix,
ftp_server_to=args.archive_prefix,
mar_channel_IDs=mar_channel_IDs,
platform=update_platform)
else:
if this_full_check_locales and is_triangualar(completes_only_index):
log.info("Generating full check configs for %s" % fromVersion)
uvc.addRelease(release=appVersion, build_id=build_id,
locales=this_full_check_locales,
from_path=from_path,
ftp_server_from=prev_archive_prefix,
ftp_server_to=args.archive_prefix,
mar_channel_IDs=mar_channel_IDs,
platform=update_platform)
# Quick test for other locales, no download
if len(quick_check_locales) > 0:
log.info("Generating quick check configs for %s" % fromVersion)
if not is_triangualar(completes_only_index):
# Assuming we skipped full check locales, using all locales
_locales = locales
else:
# Excluding full check locales from the quick check
_locales = quick_check_locales
uvc.addRelease(release=appVersion, build_id=build_id,
locales=_locales,
platform=update_platform)
completes_only_index += 1
uvc.write(args.output)