本文整理匯總了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"'])
示例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
})
示例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
})
示例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
})
示例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
})
示例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
})
示例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'
})
示例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
})
示例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'
})
示例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'
})
示例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>>>'
})
示例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'
})