コード例 #1
0
ファイル: test_git.py プロジェクト: ntauthority/gdm
 def test_changes(self, mock_call):
     """Verify the commands to check for uncommitted changes."""
     git.changes(include_untracked=True)
     assert_calls(mock_call, [
         # based on: http://stackoverflow.com/questions/3878624
         "git update-index -q --refresh",
         "git diff-index --quiet HEAD",
         "git ls-files --others --exclude-standard",
         "git status",  # used for displaying the overall status
     ])
コード例 #2
0
ファイル: test_git.py プロジェクト: nta/gdm
 def test_changes(self, mock_call):
     """Verify the commands to check for uncommitted changes."""
     git.changes(include_untracked=True)
     assert_calls(
         mock_call,
         [
             # based on: http://stackoverflow.com/questions/3878624
             "git update-index -q --refresh",
             "git diff-index --quiet HEAD",
             "git ls-files --others --exclude-standard",
             "git status",  # used for displaying the overall status
         ])
コード例 #3
0
ファイル: test_git.py プロジェクト: nta/gdm
 def test_changes_true_when_uncommitted(self, _):
     """Verify uncommitted changes can be detected."""
     with patch('gdm.git.call', Mock(side_effect=ShellError)):
         assert True is git.changes(display_status=False)
コード例 #4
0
ファイル: test_git.py プロジェクト: nta/gdm
 def test_changes_true_when_untracked_included(self, _):
     """Verify untracked files can be detected."""
     with patch('gdm.git.call', Mock(return_value="file_1")):
         assert True is git.changes(include_untracked=True)
コード例 #5
0
ファイル: test_git.py プロジェクト: nta/gdm
 def test_changes_false_with_untracked(self, _):
     """Verify untracked files can be detected."""
     with patch('gdm.git.call', Mock(return_value="file_1")):
         assert False is git.changes()
コード例 #6
0
ファイル: test_git.py プロジェクト: nta/gdm
 def test_changes_false(self, _):
     """Verify the absence of changes can be detected."""
     with patch('gdm.git.call', Mock(return_value="")):
         assert False is git.changes()
コード例 #7
0
ファイル: test_git.py プロジェクト: ntauthority/gdm
 def test_changes_true_when_uncommitted(self, _):
     """Verify uncommitted changes can be detected."""
     with patch('gdm.git.call', Mock(side_effect=ShellError)):
         assert True is git.changes(display_status=False)
コード例 #8
0
ファイル: test_git.py プロジェクト: ntauthority/gdm
 def test_changes_true_when_untracked_included(self, _):
     """Verify untracked files can be detected."""
     with patch('gdm.git.call', Mock(return_value="file_1")):
         assert True is git.changes(include_untracked=True)
コード例 #9
0
ファイル: test_git.py プロジェクト: ntauthority/gdm
 def test_changes_false_with_untracked(self, _):
     """Verify untracked files can be detected."""
     with patch('gdm.git.call', Mock(return_value="file_1")):
         assert False is git.changes()
コード例 #10
0
ファイル: test_git.py プロジェクト: ntauthority/gdm
 def test_changes_false(self, _):
     """Verify the absence of changes can be detected."""
     with patch('gdm.git.call', Mock(return_value="")):
         assert False is git.changes()