def test_git_commit_push(self): message = 'sample commit' expected_result = { 'remote': get_remote(), 'branch': get_branch(), 'commit': get_current_commit() } self.assertEqual(git_commit_push(message), expected_result)
def test_git_commit_push(mock_git_push): with mock_git_repo(): message = 'sample commit' expected_result = { 'remote': get_remote(), 'branch': get_branch(), 'commit': get_current_commit() } assert git_commit_push(message) == expected_result mock_git_push.assert_called_with()
def _perform_git_commit(filename, git_commit, git_message): if git_commit and git.is_git(): reset('git') # resets git commit info git.commit(git_message) log('Git repository identified. Performing git commit...') git_info = { 'repository': git.get_remote(), 'commit': git.get_current_commit(), 'filename': filename, 'path': git.get_relative_path(), 'branch': git.get_branch() } log_git(git_info, verbose=False)
def test_get_remote(self): expected_result = 'https://github.com/rohitsanj/mock_repo' self.assertEqual(get_remote(), expected_result)
def test_get_remote(self): expected_result = '' self.assertEqual(get_remote(), expected_result)
def test_get_remote(): with mock_git_repo(): expected_result = 'https://github.com/JovianML/mock_repo' assert get_remote() == expected_result