本文整理汇总了Python中validator.xpi.XPIManager.locale_name方法的典型用法代码示例。如果您正苦于以下问题:Python XPIManager.locale_name方法的具体用法?Python XPIManager.locale_name怎么用?Python XPIManager.locale_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类validator.xpi.XPIManager
的用法示例。
在下文中一共展示了XPIManager.locale_name方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_comparer
# 需要导入模块: from validator.xpi import XPIManager [as 别名]
# 或者: from validator.xpi.XPIManager import locale_name [as 别名]
def test_comparer():
"Tests the function that compares two packages."
ref = XPIManager("tests/resources/l10n/langpack/reference.jar")
ref.locale_name = "en-US"
extra_ref = XPIManager(
"tests/resources/l10n/langpack/extra_files_ref.jar")
pass_ = XPIManager("tests/resources/l10n/langpack/pass.jar")
pass_.locale_name = "en-US"
mfile = XPIManager(
"tests/resources/l10n/langpack/missing_file.jar")
mfile.locale_name = "en-US"
extra = XPIManager(
"tests/resources/l10n/langpack/extra_files.jar")
extra.locale_name = "en-US"
mfileent = XPIManager(
"tests/resources/l10n/langpack/missing_file_entities.jar")
mfileent.locale_name = "en-US"
ment = XPIManager(
"tests/resources/l10n/langpack/missing_entities.jar")
ment.locale_name = "en-US"
assert _compare_packs(ref, pass_) == 3
assert _compare_packs(extra_ref, pass_) == 3
assert _compare_packs(ref, extra) == 3
assert _compare_packs(ref, mfile) == 4
assert _compare_packs(ref, mfileent) == 3
assert _compare_packs(ref, ref) > 3