-
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 another test for the case when the local branch and the requ…
…ested branch are different.
- Loading branch information
1 parent
ea21a20
commit e59cbdc
Showing
1 changed file
with
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,7 +57,7 @@ def test_nonexitent_branch(self): | |
self.assertEqual(result['status'], 'ERROR') | ||
|
||
|
||
def test_local_not_in_remote(self): | ||
def test_local_not_in_remote_same_branch(self): | ||
print("TEST: 'test_local_not_in_remote'") | ||
# prepares a suitable configuration | ||
repoconf = {} | ||
|
@@ -79,6 +79,27 @@ def test_local_not_in_remote(self): | |
self.assertEqual(result['status'], 'WRONG_REMOTE') | ||
|
||
|
||
def test_local_not_in_remote_different_branch(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') | ||
# 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'], 'WRONG_REMOTE') | ||
|
||
|
||
def test_status_not_cloned(self): | ||
print("TEST: 'test_status_not_cloned'") | ||
# prepares a suitable configuration | ||
|