本文整理匯總了Python中mkt.langpacks.models.LangPack.get_minifest_contents方法的典型用法代碼示例。如果您正苦於以下問題:Python LangPack.get_minifest_contents方法的具體用法?Python LangPack.get_minifest_contents怎麽用?Python LangPack.get_minifest_contents使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類mkt.langpacks.models.LangPack
的用法示例。
在下文中一共展示了LangPack.get_minifest_contents方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_get_minifest_contents
# 需要導入模塊: from mkt.langpacks.models import LangPack [as 別名]
# 或者: from mkt.langpacks.models.LangPack import get_minifest_contents [as 別名]
def test_get_minifest_contents(self, storage_mock):
fake_manifest = {"name": u"Fake LangPäck", "developer": {"name": "Mozilla"}}
langpack = LangPack(
pk="12345678123456781234567812345678", fxos_version="2.2", version="0.3", manifest=json.dumps(fake_manifest)
)
storage_mock.size.return_value = 666
minifest_contents = json.loads(langpack.get_minifest_contents()[0])
eq_(
minifest_contents,
{
"version": "0.3",
"size": 666,
"name": u"Fake LangPäck",
"package_path": langpack.download_url,
"developer": {"name": "Mozilla"},
},
)
return langpack, minifest_contents
示例2: test_get_minifest_contents
# 需要導入模塊: from mkt.langpacks.models import LangPack [as 別名]
# 或者: from mkt.langpacks.models.LangPack import get_minifest_contents [as 別名]
def test_get_minifest_contents(self, storage_mock):
fake_manifest = {
'name': u'Fake LangPäck',
'developer': {
'name': 'Mozilla'
}
}
langpack = LangPack(
pk='12345678123456781234567812345678',
fxos_version='2.2',
version='0.3',
manifest=json.dumps(fake_manifest))
storage_mock.size.return_value = 666
minifest_contents = json.loads(langpack.get_minifest_contents())
eq_(minifest_contents,
{'version': '0.3',
'size': 666,
'name': u'Fake LangPäck',
'package_path': langpack.download_url,
'developer': {'name': 'Mozilla'}})
return langpack, minifest_contents