当前位置: 首页>>代码示例>>Python>>正文


Python ApplyPatchAction.is_applicable方法代码示例

本文整理汇总了Python中coalib.results.result_actions.ApplyPatchAction.ApplyPatchAction.is_applicable方法的典型用法代码示例。如果您正苦于以下问题:Python ApplyPatchAction.is_applicable方法的具体用法?Python ApplyPatchAction.is_applicable怎么用?Python ApplyPatchAction.is_applicable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在coalib.results.result_actions.ApplyPatchAction.ApplyPatchAction的用法示例。


在下文中一共展示了ApplyPatchAction.is_applicable方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_is_applicable_conflict

# 需要导入模块: from coalib.results.result_actions.ApplyPatchAction import ApplyPatchAction [as 别名]
# 或者: from coalib.results.result_actions.ApplyPatchAction.ApplyPatchAction import is_applicable [as 别名]
    def test_is_applicable_conflict(self):
        diff = Diff(["1\n", "2\n", "3\n"])
        diff.add_lines(2, ['a line'])

        conflict_result = Result("", "", diffs={'f': diff})
        # Applying the same diff twice will result in a conflict
        self.assertFalse(
            ApplyPatchAction.is_applicable(conflict_result, {}, {'f': diff}))
开发者ID:scriptnull,项目名称:coala,代码行数:10,代码来源:ApplyPatchActionTest.py

示例2: test_is_applicable_empty_patch

# 需要导入模块: from coalib.results.result_actions.ApplyPatchAction import ApplyPatchAction [as 别名]
# 或者: from coalib.results.result_actions.ApplyPatchAction.ApplyPatchAction import is_applicable [as 别名]
    def test_is_applicable_empty_patch(self):
        diff = Diff([], rename='new_name')
        result = Result('', '', diffs={'f': diff})

        # Two renames donot result in any change
        self.assertEqual(
            ApplyPatchAction.is_applicable(result, {}, {'f': diff}),
            'The given patches do not change anything anymore.'
        )
开发者ID:arush0311,项目名称:coala,代码行数:11,代码来源:ApplyPatchActionTest.py

示例3: test_is_applicable_conflict

# 需要导入模块: from coalib.results.result_actions.ApplyPatchAction import ApplyPatchAction [as 别名]
# 或者: from coalib.results.result_actions.ApplyPatchAction.ApplyPatchAction import is_applicable [as 别名]
    def test_is_applicable_conflict(self):
        diff = Diff(['1\n', '2\n', '3\n'])
        diff.add_lines(2, ['a line'])

        conflict_result = Result('', '', diffs={'f': diff})
        # Applying the same diff twice will result in a conflict
        self.assertIn(
            'Two or more patches conflict with each other: ',
            ApplyPatchAction.is_applicable(conflict_result, {}, {'f': diff})
        )
开发者ID:arush0311,项目名称:coala,代码行数:12,代码来源:ApplyPatchActionTest.py

示例4: test_is_applicable_without_patch

# 需要导入模块: from coalib.results.result_actions.ApplyPatchAction import ApplyPatchAction [as 别名]
# 或者: from coalib.results.result_actions.ApplyPatchAction.ApplyPatchAction import is_applicable [as 别名]
 def test_is_applicable_without_patch(self):
     result = Result('', '')
     self.assertEqual(
         ApplyPatchAction.is_applicable(result, {}, {}),
         'This result has no patch attached.'
     )
开发者ID:arush0311,项目名称:coala,代码行数:8,代码来源:ApplyPatchActionTest.py

示例5: test_is_applicable

# 需要导入模块: from coalib.results.result_actions.ApplyPatchAction import ApplyPatchAction [as 别名]
# 或者: from coalib.results.result_actions.ApplyPatchAction.ApplyPatchAction import is_applicable [as 别名]
 def test_is_applicable(self):
     diff = Diff(['1\n', '2\n', '3\n'])
     diff.delete_line(2)
     patch_result = Result('', '', diffs={'f': diff})
     self.assertTrue(
         ApplyPatchAction.is_applicable(patch_result, {}, {}))
开发者ID:arush0311,项目名称:coala,代码行数:8,代码来源:ApplyPatchActionTest.py

示例6: test_is_applicable

# 需要导入模块: from coalib.results.result_actions.ApplyPatchAction import ApplyPatchAction [as 别名]
# 或者: from coalib.results.result_actions.ApplyPatchAction.ApplyPatchAction import is_applicable [as 别名]
 def test_is_applicable(self):
     diff = Diff(["1\n", "2\n", "3\n"])
     diff.delete_line(2)
     patch_result = Result("", "", diffs={'f': diff})
     self.assertTrue(
         ApplyPatchAction.is_applicable(patch_result, {}, {}))
开发者ID:scriptnull,项目名称:coala,代码行数:8,代码来源:ApplyPatchActionTest.py

示例7: test_is_applicable_without_patch

# 需要导入模块: from coalib.results.result_actions.ApplyPatchAction import ApplyPatchAction [as 别名]
# 或者: from coalib.results.result_actions.ApplyPatchAction.ApplyPatchAction import is_applicable [as 别名]
 def test_is_applicable_without_patch(self):
     result = Result("", "")
     self.assertFalse(ApplyPatchAction.is_applicable(result, {}, {}))
开发者ID:scriptnull,项目名称:coala,代码行数:5,代码来源:ApplyPatchActionTest.py

示例8: test_is_applicable_empty_patch

# 需要导入模块: from coalib.results.result_actions.ApplyPatchAction import ApplyPatchAction [as 别名]
# 或者: from coalib.results.result_actions.ApplyPatchAction.ApplyPatchAction import is_applicable [as 别名]
 def test_is_applicable_empty_patch(self):
     empty_patch_result = Result("", "", diffs={})
     self.assertFalse(
         ApplyPatchAction.is_applicable(empty_patch_result, {}, {}))
开发者ID:scriptnull,项目名称:coala,代码行数:6,代码来源:ApplyPatchActionTest.py

示例9: test_is_applicable

# 需要导入模块: from coalib.results.result_actions.ApplyPatchAction import ApplyPatchAction [as 别名]
# 或者: from coalib.results.result_actions.ApplyPatchAction.ApplyPatchAction import is_applicable [as 别名]
 def test_is_applicable(self):
     patch_result = PatchResult("", "", {})
     result = Result("", "")
     self.assertTrue(ApplyPatchAction.is_applicable(patch_result))
     self.assertFalse(ApplyPatchAction.is_applicable(result))
开发者ID:andreimacavei,项目名称:coala,代码行数:7,代码来源:ApplyPatchActionTest.py


注:本文中的coalib.results.result_actions.ApplyPatchAction.ApplyPatchAction.is_applicable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。