Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(289)

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py

Issue 2605933002: In Git.unstaged_files, handle the case when there are no changes. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py
index 000aa153cf829af703961176ae0b267f65c7c92f..c3507e018c74690e46491b5af93b6cfa7bd5367b 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py
@@ -255,7 +255,7 @@ class GitTestWithMock(SCMTestBase):
def test_unstaged_files(self):
scm = self.make_scm()
- status_lines = [
+ lines = [
' M d/modified.txt',
' D d/deleted.txt',
'?? d/untracked.txt',
@@ -263,8 +263,7 @@ class GitTestWithMock(SCMTestBase):
'M d/modified-staged.txt',
'A d/added-staged.txt',
]
- # pylint: disable=protected-access
- scm._run_git = lambda args: '\x00'.join(status_lines) + '\x00'
+ scm._run_git = lambda _: '\x00'.join(lines) + '\x00' # pylint: disable=protected-access
self.assertEqual(
scm.unstaged_changes(),
{
@@ -272,3 +271,8 @@ class GitTestWithMock(SCMTestBase):
'd/deleted.txt': 'D',
'd/untracked.txt': '?',
})
+
+ def test_unstaged_files_with_no_changes(self):
+ scm = self.make_scm()
+ scm._run_git = lambda _: '\x00' # pylint: disable=protected-access
+ self.assertEqual(scm.unstaged_changes(), {})

Powered by Google App Engine
This is Rietveld 408576698