def setUp(self) -> None: self.python = python.Python() self.mock_update = MagicMock() setattr(self.python, 'update_dependencies', self.mock_update) self.mock_install = MagicMock() setattr(self.python, 'install_updates', self.mock_install) self.mock_log = MagicMock() setattr(self.python.util, 'log', self.mock_log)
def setUp(self) -> None: self.python = python.Python() self.mock_execute_shell = MagicMock() setattr(self.python.util, 'execute_shell', self.mock_execute_shell) self.mock_log = MagicMock() setattr(self.python.util, 'log', self.mock_log)
def setUp(self) -> None: self.tempfile = tempfile.NamedTemporaryFile() self.original_reqfiles = python.REQUIREMENTS_FILES python.REQUIREMENTS_FILES = [self.tempfile.name] self.python = python.Python()