def test_should_set_verbosity_1_if_long_flag_passed(self, mock_pulla, mock_do_pull_in, mock_pull_all): self.ensure_no_git_pull_done(mock_do_pull_in, mock_pull_all) sys.argv = ['dummy', '--verbose'] main() mock_pulla.assert_called_once_with(verbosity=1, recursive=False)
def test_should_do_pull_in_current_directory_if_is_git_dir( self, mock_is_git_dir, mock_do_pull_in, mock_pull_all ): self.ensure_no_git_pull_done(mock_do_pull_in, mock_pull_all) curdir = os.path.abspath(os.curdir) sys.argv = ['dummy'] mock_is_git_dir.return_value = True main() mock_do_pull_in.assert_called_once_with(curdir)
def test_should_do_pull_in_subdirectories_if_no_args(self, mock_is_git_dir, mock_do_pull_in, mock_pull_all): self.ensure_no_git_pull_done(mock_do_pull_in, mock_pull_all) sys.argv = ['dummy'] mock_is_git_dir.return_value = False main() curdir = os.path.abspath(os.curdir) mock_pull_all.assert_called_once_with(curdir)
def test_should_print_version_and_exit_with_long_flag(self, mock_print_version): sys.argv = ['dummy', '--version'] out = main() mock_print_version.assert_called_once_with() self.assertEqual(out, 0)