Пример #1
0
    def test_should_install_plugin_with_vcs_and_version(self):
        logger = Mock()
        reactor = Mock()
        pyb_env = Mock()
        reactor.python_env_registry = {"pybuilder": pyb_env}
        reactor.pybuilder_venv = pyb_env

        pd = PluginDef("vcs:some-plugin URL", "===1.2.3", "module_name")
        downloader = DownloadingPluginLoader(logger)
        downloader.install_plugin(reactor, pd)

        pyb_env.install_dependencies.assert_called_with([pd.dependency],
                                                        package_type="plugin")
Пример #2
0
    def test_should_download_module_from_pypi(self, load):
        logger = Mock()
        reactor = Mock()
        pyb_env = Mock()
        reactor.python_env_registry = {"pybuilder": pyb_env}
        reactor.pybuilder_venv = pyb_env

        pd = PluginDef("pypi:external_plugin")
        pl = DownloadingPluginLoader(logger)
        pl.install_plugin(reactor, pd)

        pyb_env.install_dependencies.assert_called_with(
            [Dependency("external_plugin")], package_type="plugin")
Пример #3
0
    def test_should_install_upgrade_plugin_with_non_exact_version(self):
        logger = Mock()
        reactor = Mock()
        pyb_env = Mock()
        reactor.python_env_registry = {"pybuilder": pyb_env}
        reactor.pybuilder_venv = pyb_env

        pd = PluginDef("pypi:some-plugin", "~=1.2.3")
        downloader = DownloadingPluginLoader(logger)
        downloader.install_plugin(reactor, pd)

        pyb_env.install_dependencies.assert_called_with([pd.dependency],
                                                        package_type="plugin")