def test_install_user_requirements_conda(self): python_env = Conda( version=self.version_sphinx, build_env=self.build_env_mock, ) python_env.install_user_requirements() self.build_env_mock.run.assert_not_called()
def test_install_core_requirements_mkdocs_conda(self): python_env = Conda( version=self.version_mkdocs, build_env=self.build_env_mock, ) python_env.install_core_requirements() conda_requirements = self.base_conda_requirements pip_requirements = [ 'recommonmark', 'mkdocs', ] args_pip = [ 'python', mock.ANY, # pip path 'install', '-U', '--cache-dir', mock.ANY, # cache path ] args_pip.extend(pip_requirements) args_conda = [ 'conda', 'install', '--yes', '--name', self.version_mkdocs.slug, ] args_conda.extend(conda_requirements) self.build_env_mock.run.assert_has_calls([ mock.call(*args_conda), mock.call(*args_pip, bin_path=mock.ANY) ])
def test_install_user_requirements_conda(self, checkout_path): tmpdir = tempfile.mkdtemp() checkout_path.return_value = tmpdir python_env = Conda( version=self.version_sphinx, build_env=self.build_env_mock, ) python_env.install_requirements() self.build_env_mock.run.assert_not_called()
def test_install_core_requirements_sphinx_conda(self, checkout_path): tmpdir = tempfile.mkdtemp() checkout_path.return_value = tmpdir python_env = Conda( version=self.version_sphinx, build_env=self.build_env_mock, ) python_env.install_core_requirements() conda_sphinx = [ 'sphinx', 'sphinx_rtd_theme', ] conda_requirements = self.base_conda_requirements + conda_sphinx pip_requirements = [ 'recommonmark', 'readthedocs-sphinx-ext', ] args_pip = [ mock.ANY, # python path '-m', 'pip', 'install', '-U', '--no-cache-dir', ] args_pip.extend(pip_requirements) args_conda = [ 'conda', 'install', '--yes', '--quiet', '--name', self.version_sphinx.slug, ] args_conda.extend(conda_requirements) self.build_env_mock.run.assert_has_calls([ mock.call(*args_conda, cwd=mock.ANY), mock.call(*args_pip, bin_path=mock.ANY, cwd=mock.ANY), ])