Exemplo n.º 1
0
 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)
Exemplo n.º 2
0
    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)
Exemplo n.º 3
0
    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)
Exemplo n.º 4
0
 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)