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


Python TestHelper.add_input_json_file方法代碼示例

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


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

示例1: test_SingleBuildWithCrossVerify

# 需要導入模塊: from releng.test.utils import TestHelper [as 別名]
# 或者: from releng.test.utils.TestHelper import add_input_json_file [as 別名]
 def test_SingleBuildWithCrossVerify(self):
     helper = TestHelper(self, env={
             'GERRIT_CHANGE_URL': 'http://gerrit',
             'GERRIT_PATCHSET_NUMBER': '3',
         })
     factory = helper.factory
     helper.add_input_json_file('actions.json', {
             'builds': [
                     {
                         'url': 'http://my_build',
                         'desc': None,
                         'result': 'SUCCESS'
                     }
                 ],
             'gerrit_info': {
                     'change': 1234,
                     'patchset': 5
                 }
         })
     result = do_post_build(factory, 'actions.json')
     self.assertEqual(result, {
             'url': 'http://my_build',
             'message': None
         })
     helper.assertCommandInvoked(['ssh', '-p', '29418', '[email protected]', 'gerrit', 'review', '1234,5', '-m', '"Cross-verify with http://gerrit (patch set 3) finished\n\nhttp://my_build: SUCCESS"'])
開發者ID:gromacs,項目名稱:releng,代碼行數:27,代碼來源:test_ondemand.py

示例2: test_NoBuild

# 需要導入模塊: from releng.test.utils import TestHelper [as 別名]
# 或者: from releng.test.utils.TestHelper import add_input_json_file [as 別名]
 def test_NoBuild(self):
     helper = TestHelper(self)
     factory = helper.factory
     helper.add_input_json_file('actions.json', {
             'builds': []
         })
     result = do_post_build(factory, 'actions.json')
     self.assertEqual(result, {
             'url': None,
             'message': None
         })
開發者ID:gromacs,項目名稱:releng,代碼行數:13,代碼來源:test_ondemand.py

示例3: test_NoBuild

# 需要導入模塊: from releng.test.utils import TestHelper [as 別名]
# 或者: from releng.test.utils.TestHelper import add_input_json_file [as 別名]
 def test_NoBuild(self):
     helper = TestHelper(self, workspace='ws')
     factory = helper.factory
     helper.add_input_json_file('actions.json', {
             'builds': []
         })
     do_post_build(factory, 'actions.json', 'message.json')
     helper.assertOutputJsonFile('ws/build/message.json', {
             'url': None,
             'message': None
         })
開發者ID:,項目名稱:,代碼行數:13,代碼來源:

示例4: test_SingleBuildWithDescription

# 需要導入模塊: from releng.test.utils import TestHelper [as 別名]
# 或者: from releng.test.utils.TestHelper import add_input_json_file [as 別名]
 def test_SingleBuildWithDescription(self):
     helper = TestHelper(self)
     factory = helper.factory
     helper.add_input_json_file('actions.json', {
             'builds': [
                     {
                         'url': 'http://my_build',
                         'desc': 'cross-verify',
                         'result': 'SUCCESS'
                     }
                 ]
         })
     result = do_post_build(factory, 'actions.json')
     self.assertEqual(result, {
             'url': 'http://my_build (cross-verify)',
             'message': None
         })
開發者ID:gromacs,項目名稱:releng,代碼行數:19,代碼來源:test_ondemand.py

示例5: test_SingleBuildWithDescription

# 需要導入模塊: from releng.test.utils import TestHelper [as 別名]
# 或者: from releng.test.utils.TestHelper import add_input_json_file [as 別名]
 def test_SingleBuildWithDescription(self):
     helper = TestHelper(self, workspace='ws')
     factory = helper.factory
     helper.add_input_json_file('actions.json', {
             'builds': [
                     {
                         'url': 'http://my_build',
                         'desc': 'cross-verify',
                         'result': 'SUCCESS'
                     }
                 ]
         })
     do_post_build(factory, 'actions.json', 'message.json')
     helper.assertOutputJsonFile('ws/build/message.json', {
             'url': 'http://my_build (cross-verify)',
             'message': None
         })
開發者ID:,項目名稱:,代碼行數:19,代碼來源:

示例6: test_SingleBuildWithoutUrl

# 需要導入模塊: from releng.test.utils import TestHelper [as 別名]
# 或者: from releng.test.utils.TestHelper import add_input_json_file [as 別名]
 def test_SingleBuildWithoutUrl(self):
     helper = TestHelper(self)
     factory = helper.factory
     helper.add_input_json_file('actions.json', {
             'builds': [
                     {
                         'title': 'My title',
                         'url': None,
                         'desc': None,
                         'result': 'SUCCESS'
                     }
                 ]
         })
     result = do_post_build(factory, 'actions.json')
     self.assertEqual(result, {
             'url': None,
             'message': None
         })
開發者ID:gromacs,項目名稱:releng,代碼行數:20,代碼來源:test_ondemand.py

示例7: test_FailedSingleBuild

# 需要導入模塊: from releng.test.utils import TestHelper [as 別名]
# 或者: from releng.test.utils.TestHelper import add_input_json_file [as 別名]
 def test_FailedSingleBuild(self):
     helper = TestHelper(self)
     factory = helper.factory
     helper.add_input_json_file('actions.json', {
             'builds': [
                     {
                         'url': 'http://my_build',
                         'desc': None,
                         'result': 'FAILURE',
                         'reason': 'Failure reason'
                     }
                 ]
         })
     result = do_post_build(factory, 'actions.json')
     self.assertEqual(result, {
             'url': 'http://my_build',
             'message': 'Failure reason'
         })
開發者ID:gromacs,項目名稱:releng,代碼行數:20,代碼來源:test_ondemand.py

示例8: test_SingleBuildWithoutUrl

# 需要導入模塊: from releng.test.utils import TestHelper [as 別名]
# 或者: from releng.test.utils.TestHelper import add_input_json_file [as 別名]
 def test_SingleBuildWithoutUrl(self):
     helper = TestHelper(self, workspace='ws')
     factory = helper.factory
     helper.add_input_json_file('actions.json', {
             'builds': [
                     {
                         'title': 'My title',
                         'url': None,
                         'desc': None,
                         'result': 'SUCCESS'
                     }
                 ]
         })
     do_post_build(factory, 'actions.json', 'message.json')
     helper.assertOutputJsonFile('ws/build/message.json', {
             'url': None,
             'message': None
         })
開發者ID:,項目名稱:,代碼行數:20,代碼來源:

示例9: test_FailedSingleBuild

# 需要導入模塊: from releng.test.utils import TestHelper [as 別名]
# 或者: from releng.test.utils.TestHelper import add_input_json_file [as 別名]
 def test_FailedSingleBuild(self):
     helper = TestHelper(self, workspace='ws')
     factory = helper.factory
     helper.add_input_json_file('actions.json', {
             'builds': [
                     {
                         'url': 'http://my_build',
                         'desc': None,
                         'result': 'FAILURE',
                         'reason': 'Failure reason'
                     }
                 ]
         })
     do_post_build(factory, 'actions.json', 'message.json')
     helper.assertOutputJsonFile('ws/build/message.json', {
             'url': 'http://my_build',
             'message': 'Failure reason'
         })
開發者ID:,項目名稱:,代碼行數:20,代碼來源:

示例10: test_TwoBuildsWithoutUrl

# 需要導入模塊: from releng.test.utils import TestHelper [as 別名]
# 或者: from releng.test.utils.TestHelper import add_input_json_file [as 別名]
 def test_TwoBuildsWithoutUrl(self):
     helper = TestHelper(self)
     factory = helper.factory
     helper.add_input_json_file('actions.json', {
             'builds': [
                     {
                         'url': 'http://my_build',
                         'desc': 'cross-verify',
                         'result': 'SUCCESS'
                     },
                     {
                         'title': 'My title',
                         'url': None,
                         'desc': None,
                         'result': 'SUCCESS'
                     }
                 ]
         })
     result = do_post_build(factory, 'actions.json')
     self.assertEqual(result, {
             'url': None,
             'message': 'http://my_build (cross-verify): SUCCESS\nMy title: SUCCESS'
         })
開發者ID:gromacs,項目名稱:releng,代碼行數:25,代碼來源:test_ondemand.py

示例11: test_TwoBuildsWithFailure

# 需要導入模塊: from releng.test.utils import TestHelper [as 別名]
# 或者: from releng.test.utils.TestHelper import add_input_json_file [as 別名]
 def test_TwoBuildsWithFailure(self):
     helper = TestHelper(self)
     factory = helper.factory
     helper.add_input_json_file('actions.json', {
             'builds': [
                     {
                         'url': 'http://my_build',
                         'desc': 'cross-verify',
                         'result': 'SUCCESS'
                     },
                     {
                         'url': 'http://my_build2',
                         'desc': None,
                         'result': 'FAILURE',
                         'reason': 'Failure reason'
                     }
                 ]
         })
     result = do_post_build(factory, 'actions.json')
     self.assertEqual(result, {
             'url': None,
             'message': 'http://my_build (cross-verify): SUCCESS\nhttp://my_build2: FAILURE <<<\nFailure reason\n>>>'
         })
開發者ID:gromacs,項目名稱:releng,代碼行數:25,代碼來源:test_ondemand.py

示例12: test_TwoBuildsWithoutUrl

# 需要導入模塊: from releng.test.utils import TestHelper [as 別名]
# 或者: from releng.test.utils.TestHelper import add_input_json_file [as 別名]
 def test_TwoBuildsWithoutUrl(self):
     helper = TestHelper(self, workspace='ws')
     factory = helper.factory
     helper.add_input_json_file('actions.json', {
             'builds': [
                     {
                         'url': 'http://my_build',
                         'desc': 'cross-verify',
                         'result': 'SUCCESS'
                     },
                     {
                         'title': 'My title',
                         'url': None,
                         'desc': None,
                         'result': 'SUCCESS'
                     }
                 ]
         })
     do_post_build(factory, 'actions.json', 'message.json')
     helper.assertOutputJsonFile('ws/build/message.json', {
             'url': None,
             'message': 'http://my_build (cross-verify): SUCCESS\nMy title: SUCCESS'
         })
開發者ID:,項目名稱:,代碼行數:25,代碼來源:


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