-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#9: added test to control requested local branch not in remote behavi…
…our.
- Loading branch information
1 parent
a951f43
commit 14221a4
Showing
3 changed files
with
25 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
|
||
# Import stuff | ||
import unittest | ||
from git import Repo | ||
from . import TESTS_PATH, PROJECT_PATH | ||
|
||
import os, shutil | ||
|
@@ -56,6 +57,28 @@ def test_nonexitent_branch(self): | |
self.assertEqual(result['status'], 'ERROR') | ||
|
||
|
||
def test_local_not_in_remote(self): | ||
print("TEST: 'test_local_not_in_remote'") | ||
# prepares a suitable configuration | ||
repoconf = {} | ||
repoconf['repo'] = '[email protected]:jmnavarrol/simplest-git-subrepos.git' | ||
repoconf['path'] = os.path.join(self.scenarios_path, 'standard/simplest-git-subrepos') | ||
|
||
# First, let's clone the repo | ||
result = self.gitrepo.update(repoconf) | ||
print(str(result)) | ||
# Then, let's create a local branch | ||
repo = Repo(repoconf['path']) | ||
new_branch = repo.create_head('new_branch') | ||
new_branch.checkout() | ||
# Finally, let's update config to request the new local branch | ||
repoconf['branch'] = 'new_branch' | ||
repoconf['gitref_type'] = 'branch' | ||
result = self.gitrepo.update(repoconf) | ||
print(str(result)) | ||
self.assertEqual(result['status'], 'ERROR') | ||
|
||
|
||
def test_status_not_cloned(self): | ||
print("TEST: 'test_status_not_cloned'") | ||
# prepares a suitable configuration | ||
|