Example #1
0
File: test_git.py Project: nta/gdm
 def test_update_no_clean(self, mock_call):
     git.update('mock_rev', clean=False)
     assert_calls(mock_call, [
         "git stash",
         "git checkout --force mock_rev",
         "git branch --set-upstream-to origin/mock_rev",
     ])
Example #2
0
 def test_update_no_clean(self, mock_call):
     git.update('mock_rev', clean=False)
     assert_calls(mock_call, [
         "git stash",
         "git checkout --force mock_rev",
         "git branch --set-upstream-to origin/mock_rev",
     ])
Example #3
0
File: test_git.py Project: nta/gdm
 def test_update(self, mock_call):
     """Verify the commands to update a working tree to a revision."""
     git.update('mock_rev')
     assert_calls(mock_call, [
         "git stash",
         "git clean --force -d -x",
         "git checkout --force mock_rev",
         "git branch --set-upstream-to origin/mock_rev",
     ])
Example #4
0
 def test_update(self, mock_call):
     """Verify the commands to update a working tree to a revision."""
     git.update('mock_rev')
     assert_calls(mock_call, [
         "git stash",
         "git clean --force -d -x",
         "git checkout --force mock_rev",
         "git branch --set-upstream-to origin/mock_rev",
     ])
Example #5
0
File: test_git.py Project: nta/gdm
 def test_update_branch(self, mock_call):
     """Verify the commands to update a working tree to a branch."""
     git.update('mock_branch', fetch=True)
     assert_calls(mock_call, [
         "git stash",
         "git clean --force -d -x",
         "git checkout --force mock_branch",
         "git branch --set-upstream-to origin/mock_branch",
         "git pull --ff-only --no-rebase",
     ])
Example #6
0
 def test_update_branch(self, mock_call):
     """Verify the commands to update a working tree to a branch."""
     git.update('mock_branch', fetch=True)
     assert_calls(mock_call, [
         "git stash",
         "git clean --force -d -x",
         "git checkout --force mock_branch",
         "git branch --set-upstream-to origin/mock_branch",
         "git pull --ff-only --no-rebase",
     ])
Example #7
0
File: test_git.py Project: nta/gdm
 def test_update_revparse(self, mock_call):
     """Verify the commands to update a working tree to a rev-parse."""
     mock_call.return_value = "abc123"
     git.update('mock_branch@{2015-02-12 18:30:00}')
     assert_calls(mock_call, [
         "git stash",
         "git clean --force -d -x",
         "git checkout --force mock_branch",
         "git rev-list -n 1 --before='2015-02-12 18:30:00' mock_branch",
         "git checkout --force abc123",
         "git branch --set-upstream-to origin/abc123",
     ])
Example #8
0
 def test_update_revparse(self, mock_call):
     """Verify the commands to update a working tree to a rev-parse."""
     mock_call.return_value = "abc123"
     git.update('mock_branch@{2015-02-12 18:30:00}')
     assert_calls(mock_call, [
         "git stash",
         "git clean --force -d -x",
         "git checkout --force mock_branch",
         "git rev-list -n 1 --before='2015-02-12 18:30:00' mock_branch",
         "git checkout --force abc123",
         "git branch --set-upstream-to origin/abc123",
     ])