Add new unit tests for RBTools's Git support

Review Request #8099 — Created April 4, 2016 and submitted — Latest diff uploaded

Information

RBTools
master

Reviewers

Add new unit tests for RBTools's Git support (this review request covers most of the tests in the project description at https://student-sonar.herokuapp.com/projects)

Wrote the following test cases for the following methods of the the GitClient class -

Method name - push_upstream() -
1) Tested push_upstream() with an invalid target branch. The 'git_pull' must raise a PushError exception.
2) Tested push_upstream() with the push_url set to be an invalid one. Neither the 'pull' or the 'push' must raise an exception because it gets it's origin_url from the Git config which still has a valid fetch_url

Method name - merge()
1) Tested merge() with invalid target and destination branches. Both of these must raise a MergeError exception
2) Tested merge() with squash set to True and False. Used a KGB spy to check if execute was called with the right arguments.

Method name - create_commit()
1) Tested create_commit() with run_editor set to True and False. Used a KGB spy to check if edit_text was called or not.
2) Tested create_commit() with all_files set to True and False. Used a KGB spy to check if execute was called with the right arguments.

Method name - delete_branch()
1) Tested delete_branch() with merged_only set to True and False. Used a KGB spy to check if execute was called with the right arguments.