Пример #1
0
    def setUp(self):
        self.logger = Mock()
        self.project = Project(".")
        self.project.set_property("dir_target", "dir_target_value")
        self.project.set_property("dir_source_main_python", "dir_source_main_python_value")
        self.project.set_property("dir_reports", "dir_reports_value")

        self.reactor = Mock()
        pyb_env = Mock()
        pyb_env.environ = {"PATH": "a"}
        self.reactor.python_env_registry = {"pybuilder": pyb_env}
        self.reactor.pybuilder_venv = pyb_env
Пример #2
0
 def test_pip_install_environ_inherited(self):
     python_env = Mock()
     python_env.executable = []
     python_env.environ = {}
     pip_utils.pip_install("blah", python_env)
     python_env.execute_command.assert_called_once_with(
         ANY,
         cwd=None,
         env=python_env.environ,
         error_file_name=None,
         outfile_name=None,
         shell=False,
         no_path_search=True)
Пример #3
0
 def test_pip_install_environ_overwritten(self):
     env_dict = {"a": "b"}
     python_env = Mock()
     python_env.executable = []
     python_env.environ = {}
     pip_utils.pip_install("blah", python_env, env=env_dict)
     python_env.execute_command.assert_called_once_with(
         ANY,
         cwd=None,
         env=env_dict,
         error_file_name=None,
         outfile_name=None,
         shell=False,
         no_path_search=True)