當前位置: 首頁>>代碼示例>>Python>>正文


Python LangPack.get_minifest_contents方法代碼示例

本文整理匯總了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
開發者ID:jobava-mozilla,項目名稱:zamboni,代碼行數:21,代碼來源:test_models.py

示例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
開發者ID:atiqueahmedziad,項目名稱:zamboni,代碼行數:24,代碼來源:test_models.py


注:本文中的mkt.langpacks.models.LangPack.get_minifest_contents方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。