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


Python Runs.json_by_ids方法代碼示例

本文整理匯總了Python中models.Runs.json_by_ids方法的典型用法代碼示例。如果您正苦於以下問題:Python Runs.json_by_ids方法的具體用法?Python Runs.json_by_ids怎麽用?Python Runs.json_by_ids使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在models.Runs的用法示例。


在下文中一共展示了Runs.json_by_ids方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: get

# 需要導入模塊: from models import Runs [as 別名]
# 或者: from models.Runs import json_by_ids [as 別名]
    def get(self):
        self.response.headers['Content-Type'] = 'application/json'

        test_id, branch_id, platform_id = _get_test_branch_platform_ids(self)
        runs = Runs.json_by_ids(branch_id, platform_id, test_id)
        if runs:
            self.response.out.write(runs)
        elif model_from_numeric_id(branch_id, Branch) and model_from_numeric_id(platform_id, Platform) and model_from_numeric_id(test_id, Test):
            schedule_runs_update(test_id, branch_id, platform_id)
開發者ID:,項目名稱:,代碼行數:11,代碼來源:

示例2: test_json_by_ids

# 需要導入模塊: from models import Runs [as 別名]
# 或者: from models.Runs import json_by_ids [as 別名]
    def test_json_by_ids(self):
        some_branch = Branch.create_if_possible('some-branch', 'Some Branch')
        some_platform = Platform.create_if_possible('some-platform', 'Some Platform')
        some_builder = Builder.get(Builder.create('some-builder', 'Some Builder'))
        some_test = Test.update_or_insert('some-test', some_branch, some_platform)

        self._create_results(some_branch, some_platform, some_builder, 'some-test', [50.0])
        runs = Runs.update_or_insert(some_branch, some_platform, some_test)
        runs_json = runs.to_json()

        key_name = Runs._key_name(some_branch.id, some_platform.id, some_test.id)
        self.assertEqual(Runs.json_by_ids(some_branch.id, some_platform.id, some_test.id), runs_json)
        self.assertEqual(memcache.get(key_name), runs_json)

        memcache.set(key_name, 'blah')
        self.assertEqual(Runs.json_by_ids(some_branch.id, some_platform.id, some_test.id), 'blah')

        memcache.delete(key_name)
        self.assertEqual(Runs.json_by_ids(some_branch.id, some_platform.id, some_test.id), runs_json)
        self.assertEqual(memcache.get(key_name), runs_json)
開發者ID:,項目名稱:,代碼行數:22,代碼來源:


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