예제 #1
0
파일: test_cli.py 프로젝트: aepsil0n/gitman
    def test_update_lock(self, mock_update):
        """Verify the 'update' command can enable locking."""
        cli.main(['update', '--lock'])

        mock_update.assert_called_once_with(
            root=None, depth=5,
            force=False, clean=False, recurse=False, lock=True)
예제 #2
0
파일: test_cli.py 프로젝트: aepsil0n/gitman
    def test_install_root(self, mock_install):
        """Verify the project's root can be specified."""
        cli.main(['install', '--root', 'mock/path/to/root'])

        mock_install.assert_called_once_with(
            root='mock/path/to/root', depth=5,
            force=False, fetch=False, clean=False)
예제 #3
0
파일: test_cli.py 프로젝트: aepsil0n/gitman
    def test_update_recursive(self, mock_update):
        """Verify the 'update' command can be run recursively."""
        cli.main(['update', '--all'])

        mock_update.assert_called_once_with(
            root=None, depth=5,
            force=False, clean=False, recurse=True, lock=None)
예제 #4
0
파일: test_cli.py 프로젝트: wildi1/gitman
    def test_list(self, mock_display):
        """Verify the 'list' command can be run."""
        cli.main(['list'])

        mock_display.assert_called_once_with(root=None,
                                             depth=5,
                                             allow_dirty=True)
예제 #5
0
파일: test_cli.py 프로젝트: aepsil0n/gitman
    def test_main(self):
        """Verify the top-level command can be run."""
        mock_function = Mock(return_value=True)

        cli.main([], mock_function)

        mock_function.assert_called_once_with()
예제 #6
0
파일: test_cli.py 프로젝트: aepsil0n/gitman
    def test_update_with_depth(self, mock_update):
        """Verify the 'update' command can be limited by depth."""
        cli.main(['update', '--depth', '10'])

        mock_update.assert_called_once_with(
            root=None, depth=10,
            force=False, clean=False, recurse=False, lock=None)
예제 #7
0
파일: test_cli.py 프로젝트: wildi1/gitman
    def test_list_no_dirty(self, mock_display):
        """Verify the 'list' command can be set to fail when dirty."""
        cli.main(['list', '--fail-if-dirty'])

        mock_display.assert_called_once_with(root=None,
                                             depth=5,
                                             allow_dirty=False)
예제 #8
0
파일: test_cli.py 프로젝트: aepsil0n/gitman
    def test_install_specific_sources(self, mock_install):
        """Verify individual dependencies can be installed."""
        cli.main(['install', 'foo', 'bar'])

        mock_install.assert_called_once_with(
            'foo', 'bar', root=None, depth=5,
            force=False, fetch=False, clean=False)
예제 #9
0
파일: test_cli.py 프로젝트: wildi1/gitman
    def test_update_with_depth(self, mock_update):
        """Verify the 'list' command can be limited by depth."""
        cli.main(['list', '--depth', '10'])

        mock_update.assert_called_once_with(root=None,
                                            depth=10,
                                            allow_dirty=True)
예제 #10
0
파일: test_cli.py 프로젝트: wildi1/gitman
    def test_uninstall_force(self, mock_uninstall):
        """Verify the 'uninstall' command can be forced."""
        cli.main(['uninstall', '--force'])

        mock_uninstall.assert_called_once_with(root=None,
                                               force=True,
                                               keep_location=False)
예제 #11
0
파일: test_cli.py 프로젝트: wildi1/gitman
    def test_uninstall_root(self, mock_uninstall):
        """Verify the project's root can be specified."""
        cli.main(['uninstall', '--root', 'mock/path/to/root'])

        mock_uninstall.assert_called_once_with(root='mock/path/to/root',
                                               force=False,
                                               keep_location=False)
예제 #12
0
파일: test_cli.py 프로젝트: wildi1/gitman
    def test_main(self):
        """Verify the top-level command can be run."""
        mock_function = Mock(return_value=True)

        cli.main([], mock_function)

        mock_function.assert_called_once_with()
예제 #13
0
파일: test_cli.py 프로젝트: wildi1/gitman
    def test_uninstall_keep_location(self, mock_uninstall):
        """Verify the 'uninstall' command can be run with keep_location."""
        cli.main(['uninstall', '--keep-location'])

        mock_uninstall.assert_called_once_with(root=None,
                                               force=False,
                                               keep_location=True)
예제 #14
0
파일: test_cli.py 프로젝트: wildi1/gitman
    def test_list_root(self, mock_display):
        """Verify the project's root can be specified."""
        cli.main(['list', '--root', 'mock/path/to/root'])

        mock_display.assert_called_once_with(root='mock/path/to/root',
                                             depth=5,
                                             allow_dirty=True)
예제 #15
0
파일: test_cli.py 프로젝트: xenji/gitman
    def test_install_with_depth(self, mock_update):
        """Verify the 'install' command can be limited by depth."""
        cli.main(['install', '--depth', '10'])

        mock_update.assert_called_once_with(root=None,
                                            depth=10,
                                            force=False,
                                            fetch=False,
                                            clean=False)
예제 #16
0
파일: test_cli.py 프로젝트: xenji/gitman
    def test_install_clean(self, mock_install):
        """Verify dependency cleaning can be enabled."""
        cli.main(['install', '--clean'])

        mock_install.assert_called_once_with(root=None,
                                             depth=5,
                                             force=False,
                                             fetch=False,
                                             clean=True)
예제 #17
0
파일: test_cli.py 프로젝트: xenji/gitman
    def test_install_fetch(self, mock_install):
        """Verify fetching can be enabled."""
        cli.main(['install', '--fetch'])

        mock_install.assert_called_once_with(root=None,
                                             depth=5,
                                             force=False,
                                             fetch=True,
                                             clean=False)
예제 #18
0
파일: test_cli.py 프로젝트: xenji/gitman
    def test_install_force(self, mock_install):
        """Verify dependencies can be force-installed."""
        cli.main(['install', '--force'])

        mock_install.assert_called_once_with(root=None,
                                             depth=5,
                                             force=True,
                                             fetch=False,
                                             clean=False)
예제 #19
0
파일: test_cli.py 프로젝트: xenji/gitman
    def test_install_root(self, mock_install):
        """Verify the project's root can be specified."""
        cli.main(['install', '--root', 'mock/path/to/root'])

        mock_install.assert_called_once_with(root='mock/path/to/root',
                                             depth=5,
                                             force=False,
                                             fetch=False,
                                             clean=False)
예제 #20
0
파일: test_cli.py 프로젝트: xenji/gitman
    def test_install(self, mock_install):
        """Verify the 'install' command can be run."""
        cli.main(['install'])

        mock_install.assert_called_once_with(root=None,
                                             depth=5,
                                             force=False,
                                             fetch=False,
                                             clean=False)
예제 #21
0
파일: test_cli.py 프로젝트: wildi1/gitman
    def at_each_level(argument, verbosity):
        def function(*args, **kwargs):
            logging.debug(args)
            logging.debug(kwargs)
            logging.warning("warning")
            logging.error("error")
            return True

        cli.main([argument] if argument else [], function)
        expect(_Config.verbosity) == verbosity
예제 #22
0
파일: test_cli.py 프로젝트: xenji/gitman
    def test_update_lock(self, mock_update):
        """Verify the 'update' command can enable locking."""
        cli.main(['update', '--lock'])

        mock_update.assert_called_once_with(root=None,
                                            depth=5,
                                            force=False,
                                            clean=False,
                                            recurse=False,
                                            lock=True)
예제 #23
0
파일: test_cli.py 프로젝트: xenji/gitman
    def test_update_with_depth(self, mock_update):
        """Verify the 'update' command can be limited by depth."""
        cli.main(['update', '--depth', '10'])

        mock_update.assert_called_once_with(root=None,
                                            depth=10,
                                            force=False,
                                            clean=False,
                                            recurse=False,
                                            lock=None)
예제 #24
0
파일: test_cli.py 프로젝트: xenji/gitman
    def test_update_recursive(self, mock_update):
        """Verify the 'update' command can be run recursively."""
        cli.main(['update', '--all'])

        mock_update.assert_called_once_with(root=None,
                                            depth=5,
                                            force=False,
                                            clean=False,
                                            recurse=True,
                                            lock=None)
예제 #25
0
파일: test_cli.py 프로젝트: xenji/gitman
    def test_install_specific_sources(self, mock_install):
        """Verify individual dependencies can be installed."""
        cli.main(['install', 'foo', 'bar'])

        mock_install.assert_called_once_with('foo',
                                             'bar',
                                             root=None,
                                             depth=5,
                                             force=False,
                                             fetch=False,
                                             clean=False)
예제 #26
0
파일: test_cli.py 프로젝트: aepsil0n/gitman
    def at_each_level(argument, verbosity):

        def function(*args, **kwargs):
            logging.debug(args)
            logging.debug(kwargs)
            logging.warning("warning")
            logging.error("error")
            return True

        cli.main([argument] if argument else [], function)
        expect(_Config.verbosity) == verbosity
예제 #27
0
    def test_update(self, mock_update):
        """Verify the 'update' command can be run."""
        cli.main(['update'])

        mock_update.assert_called_once_with(
            root=None,
            depth=5,
            force=False,
            clean=False,
            recurse=False,
            lock=None,
            skip_changes=False,
        )
예제 #28
0
    def test_update_skip_changes(self, mock_update):
        """Verify the 'update' command with skip changes option."""
        cli.main(['update', '--skip-changes'])

        mock_update.assert_called_once_with(
            root=None,
            depth=5,
            force=False,
            clean=False,
            recurse=False,
            lock=None,
            skip_changes=True,
        )
예제 #29
0
    def test_install_force(self, mock_install):
        """Verify dependencies can be force-installed."""
        cli.main(['install', '--force'])

        mock_install.assert_called_once_with(
            root=None,
            depth=5,
            force=True,
            force_interactive=False,
            fetch=False,
            clean=False,
            skip_changes=False,
            skip_default_group=False,
        )
예제 #30
0
    def test_install(self, mock_install):
        """Verify the 'install' command can be run."""
        cli.main(['install'])

        mock_install.assert_called_once_with(
            root=None,
            depth=5,
            force=False,
            force_interactive=False,
            fetch=False,
            clean=False,
            skip_changes=False,
            skip_default_group=False,
        )
예제 #31
0
    def test_install_fetch(self, mock_install):
        """Verify fetching can be enabled."""
        cli.main(['install', '--fetch'])

        mock_install.assert_called_once_with(
            root=None,
            depth=5,
            force=False,
            force_interactive=False,
            fetch=True,
            clean=False,
            skip_changes=False,
            skip_default_group=False,
        )
예제 #32
0
파일: test_cli.py 프로젝트: wildi1/gitman
    def test_update_no_lock(self, mock_update):
        """Verify the 'update' command can disable locking."""
        cli.main(['update', '--skip-lock'])

        mock_update.assert_called_once_with(
            root=None,
            depth=5,
            force=False,
            force_interactive=False,
            clean=False,
            recurse=False,
            lock=False,
            skip_changes=False,
        )
예제 #33
0
파일: test_cli.py 프로젝트: wildi1/gitman
    def test_update_force_interactive(self, mock_update):
        """Verify the 'update' command with force-interactive option."""
        cli.main(['update', '--force-interactive'])

        mock_update.assert_called_once_with(
            root=None,
            depth=5,
            force=False,
            force_interactive=True,
            clean=False,
            recurse=False,
            lock=None,
            skip_changes=False,
        )
예제 #34
0
    def test_update_specific_sources(self, mock_install):
        """Verify individual dependencies can be installed."""
        cli.main(['update', 'foo', 'bar'])

        mock_install.assert_called_once_with(
            'foo',
            'bar',
            root=None,
            depth=5,
            force=False,
            clean=False,
            recurse=False,
            lock=None,
            skip_changes=False,
        )
예제 #35
0
파일: test_cli.py 프로젝트: aepsil0n/gitman
 def with_root(show):
     cli.main(['show', '--root', "mock/root"])
     show.assert_called_once_with(root="mock/root")
예제 #36
0
파일: test_cli.py 프로젝트: aepsil0n/gitman
 def with_names(show):
     cli.main(['show', 'foo', 'bar'])
     show.assert_called_once_with('foo', 'bar', root=None)
예제 #37
0
파일: test_cli.py 프로젝트: aepsil0n/gitman
 def with_config(show):
     cli.main(['show', '--config'])
     show.assert_called_once_with('__config__', root=None)
예제 #38
0
파일: test_cli.py 프로젝트: aepsil0n/gitman
    def it_launches_the_config(launch, config):
        cli.main(['edit'])

        expect(launch.mock_calls) == [call(config), call().__bool__()]
예제 #39
0
파일: test_cli.py 프로젝트: aepsil0n/gitman
 def test_main_fail(self):
     """Verify error in commands are detected."""
     with pytest.raises(SystemExit):
         cli.main([], Mock(return_value=False))
예제 #40
0
파일: test_cli.py 프로젝트: wildi1/gitman
 def with_no_arguments(edit):
     cli.main(['edit'])
     edit.assert_called_once_with(root=None)
예제 #41
0
파일: test_cli.py 프로젝트: aepsil0n/gitman
    def test_uninstall_root(self, mock_uninstall):
        """Verify the project's root can be specified."""
        cli.main(['uninstall', '--root', 'mock/path/to/root'])

        mock_uninstall.assert_called_once_with(
            root='mock/path/to/root', force=False)
예제 #42
0
파일: test_cli.py 프로젝트: aepsil0n/gitman
 def with_log(show):
     cli.main(['show', '--log'])
     show.assert_called_once_with('__log__', root=None)
예제 #43
0
파일: test_cli.py 프로젝트: aepsil0n/gitman
 def with_no_arguments(edit):
     cli.main(['edit'])
     edit.assert_called_once_with(root=None)
예제 #44
0
파일: test_cli.py 프로젝트: aepsil0n/gitman
 def with_root(edit):
     cli.main(['edit', '--root', "mock/root"])
     edit.assert_called_once_with(root="mock/root")
예제 #45
0
파일: test_cli.py 프로젝트: aepsil0n/gitman
    def test_install_clean(self, mock_install):
        """Verify dependency cleaning can be enabled."""
        cli.main(['install', '--clean'])

        mock_install.assert_called_once_with(
            root=None, depth=5, force=False, fetch=False, clean=True)
예제 #46
0
파일: test_cli.py 프로젝트: aepsil0n/gitman
    def test_install_fetch(self, mock_install):
        """Verify fetching can be enabled."""
        cli.main(['install', '--fetch'])

        mock_install.assert_called_once_with(
            root=None, depth=5, force=False, fetch=True, clean=False)
예제 #47
0
파일: test_cli.py 프로젝트: aepsil0n/gitman
    def test_install_force(self, mock_install):
        """Verify dependencies can be force-installed."""
        cli.main(['install', '--force'])

        mock_install.assert_called_once_with(
            root=None, depth=5, force=True, fetch=False, clean=False)
예제 #48
0
파일: test_cli.py 프로젝트: aepsil0n/gitman
 def with_no_arguments(show):
     cli.main(['show'])
     show.assert_called_once_with(root=None)
예제 #49
0
파일: test_cli.py 프로젝트: aepsil0n/gitman
    def test_uninstall_force(self, mock_uninstall):
        """Verify the 'uninstall' command can be forced."""
        cli.main(['uninstall', '--force'])

        mock_uninstall.assert_called_once_with(
            root=None, force=True)
예제 #50
0
파일: test_cli.py 프로젝트: aepsil0n/gitman
 def test_main_help(self):
     """Verify the help text can be displayed."""
     with pytest.raises(SystemExit):
         cli.main(['--help'])
예제 #51
0
파일: test_cli.py 프로젝트: aepsil0n/gitman
    def test_uninstall(self, mock_uninstall):
        """Verify the 'uninstall' command can be run."""
        cli.main(['uninstall'])

        mock_uninstall.assert_called_once_with(
            root=None, force=False)
예제 #52
0
파일: test_cli.py 프로젝트: aepsil0n/gitman
    def it_prints_location_by_default(show, location):
        cli.main(['show'])

        expect(show.mock_calls) == [call(location)]
예제 #53
0
파일: test_cli.py 프로젝트: wildi1/gitman
 def with_root(edit):
     cli.main(['edit', '--root', "mock/root"])
     edit.assert_called_once_with(root="mock/root")
예제 #54
0
파일: test_cli.py 프로젝트: aepsil0n/gitman
 def test_main_error(self):
     """Verify runtime errors are handled."""
     with pytest.raises(SystemExit):
         cli.main([], Mock(side_effect=RuntimeError))
예제 #55
0
파일: test_cli.py 프로젝트: wildi1/gitman
    def test_install(self, mock_init):
        """Verify the 'install' command can be run."""
        cli.main(['init'])

        mock_init.assert_called_once_with()
예제 #56
0
파일: test_cli.py 프로젝트: aepsil0n/gitman
    def test_install(self, mock_install):
        """Verify the 'install' command can be run."""
        cli.main(['install'])

        mock_install.assert_called_once_with(
            root=None, depth=5, force=False, fetch=False, clean=False)
예제 #57
0
파일: test_cli.py 프로젝트: aepsil0n/gitman
    def it_can_print_a_depenendcy_path(show, location):
        cli.main(['show', 'bar'])

        expect(show.mock_calls) == [call(os.path.join(location, "bar"))]
예제 #58
0
파일: test_cli.py 프로젝트: aepsil0n/gitman
 def test_main_interrupt(self):
     """Verify a command can be interrupted."""
     with pytest.raises(SystemExit):
         cli.main([], Mock(side_effect=KeyboardInterrupt))
예제 #59
0
파일: test_cli.py 프로젝트: aepsil0n/gitman
    def it_exits_when_no_config_found(tmpdir):
        tmpdir.chdir()

        with expect.raises(SystemExit):
            cli.main(['edit'])
예제 #60
0
파일: test_cli.py 프로젝트: aepsil0n/gitman
 def test_main_none(self):
     """Verify it's an error to specify no command."""
     with pytest.raises(SystemExit):
         cli.main([])