本文整理汇总了Python中lintreview.diff.DiffCollection.has_line_changed方法的典型用法代码示例。如果您正苦于以下问题:Python DiffCollection.has_line_changed方法的具体用法?Python DiffCollection.has_line_changed怎么用?Python DiffCollection.has_line_changed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lintreview.diff.DiffCollection
的用法示例。
在下文中一共展示了DiffCollection.has_line_changed方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_has_line_changed__single_line
# 需要导入模块: from lintreview.diff import DiffCollection [as 别名]
# 或者: from lintreview.diff.DiffCollection import has_line_changed [as 别名]
def test_has_line_changed__single_line(self):
filename = 'some.js'
pull_file = create_pull_files(self.single_line_add_json)
changes = DiffCollection(pull_file)
self.assertTrue(changes.has_line_changed(filename, 1))
self.assertFalse(changes.has_line_changed(filename, 0))
self.assertFalse(changes.has_line_changed(filename, 2))
示例2: test_has_line_changed__two_files
# 需要导入模块: from lintreview.diff import DiffCollection [as 别名]
# 或者: from lintreview.diff.DiffCollection import has_line_changed [as 别名]
def test_has_line_changed__two_files(self):
changes = DiffCollection(self.two_files)
filename = 'Console/Command/Task/AssetBuildTask.php'
# True for additions
self.assertTrue(changes.has_line_changed(filename, 117))
self.assertTrue(changes.has_line_changed(filename, 119))
# Should return false if the line was a deletion
self.assertFalse(changes.has_line_changed(filename, 148))
# Should return false for unchanged
self.assertFalse(changes.has_line_changed(filename, 145))
示例3: test_has_line_changed__no_line
# 需要导入模块: from lintreview.diff import DiffCollection [as 别名]
# 或者: from lintreview.diff.DiffCollection import has_line_changed [as 别名]
def test_has_line_changed__no_line(self):
changes = DiffCollection(self.two_files)
self.assertFalse(changes.has_line_changed(
'Console/Command/Task/AssetBuildTask.php',
99999))
示例4: test_has_line_changed__no_file
# 需要导入模块: from lintreview.diff import DiffCollection [as 别名]
# 或者: from lintreview.diff.DiffCollection import has_line_changed [as 别名]
def test_has_line_changed__no_file(self):
changes = DiffCollection(self.two_files)
self.assertFalse(changes.has_line_changed('derp', 99))