def test_install_core_requirements_sphinx(self, checkout_path): tmpdir = tempfile.mkdtemp() checkout_path.return_value = tmpdir python_env = Virtualenv( version=self.version_sphinx, build_env=self.build_env_mock, ) python_env.install_core_requirements() requirements_sphinx = [ 'commonmark', 'recommonmark', 'sphinx', 'sphinx-rtd-theme', 'readthedocs-sphinx-ext', ] self.assertEqual(self.build_env_mock.run.call_count, 2) calls = self.build_env_mock.run.call_args_list core_args = self.pip_install_args + ['pip', 'setuptools<58.3.0'] self.assertArgsStartsWith(core_args, calls[0]) requirements = self.base_requirements + requirements_sphinx args = self.pip_install_args + requirements self.assertArgsStartsWith(args, calls[1])
def test_install_core_requirements_mkdocs(self): python_env = Virtualenv(version=self.version_mkdocs, build_env=self.build_env_mock) python_env.install_core_requirements() requirements_mkdocs = [ 'commonmark==0.5.4', 'recommonmark==0.4.0', 'mkdocs==0.15.0', ] requirements = self.base_requirements + requirements_mkdocs args = self.pip_install_args + requirements self.build_env_mock.run.assert_called_once_with(*args, bin_path=mock.ANY)
def test_install_core_requirements_sphinx(self): python_env = Virtualenv( version=self.version_sphinx, build_env=self.build_env_mock, ) python_env.install_core_requirements() requirements_sphinx = [ 'commonmark==0.5.4', 'recommonmark==0.4.0', 'sphinx==1.7.4', 'sphinx-rtd-theme<0.4', 'readthedocs-sphinx-ext<0.6', ] requirements = self.base_requirements + requirements_sphinx args = self.pip_install_args + requirements self.build_env_mock.run.assert_called_once_with(*args, bin_path=mock.ANY)
def test_install_core_requirements_sphinx_system_packages_caps_setuptools( self, checkout_path, load_config): config_data = { 'python': { 'use_system_site_packages': True, }, } load_config.side_effect = create_load(config_data) config = load_yaml_config(self.version_sphinx) tmpdir = tempfile.mkdtemp() checkout_path.return_value = tmpdir python_env = Virtualenv( version=self.version_sphinx, build_env=self.build_env_mock, config=config, ) python_env.install_core_requirements() requirements_sphinx = [ 'commonmark', 'recommonmark', 'sphinx', 'sphinx-rtd-theme', 'readthedocs-sphinx-ext', 'setuptools<58.3.0', ] self.assertEqual(self.build_env_mock.run.call_count, 2) calls = self.build_env_mock.run.call_args_list core_args = self.pip_install_args + ['pip', 'setuptools<58.3.0'] self.assertArgsStartsWith(core_args, calls[0]) requirements = self.base_requirements + requirements_sphinx args = self.pip_install_args + ['-I'] + requirements self.assertArgsStartsWith(args, calls[1])