From 185ceb32fea5d5c2a43d7b6ee2a40228489055f4 Mon Sep 17 00:00:00 2001 From: Ɓukasz 'sil2100' Zemczak Date: Mon, 4 Sep 2017 10:27:07 +0200 Subject: Import patches-unapplied version 2.2.16-0ubuntu1 to ubuntu/artful-proposed Imported using git-ubuntu import. Changelog parent: 43bdf9debe5377216aed0086bff2aad864f6ba82 New changelog entries: * New upstream release (LP: #1714299). --- tests/tools.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests/tools.py') diff --git a/tests/tools.py b/tests/tools.py index a505700..94fab7f 100644 --- a/tests/tools.py +++ b/tests/tools.py @@ -26,8 +26,10 @@ import tempfile import unittest from functools import wraps +import azurelinuxagent.common.event as event import azurelinuxagent.common.conf as conf import azurelinuxagent.common.logger as logger + from azurelinuxagent.common.version import PY_VERSION_MAJOR #Import mock module for Python2 and Python3 @@ -51,14 +53,21 @@ if debug: class AgentTestCase(unittest.TestCase): def setUp(self): prefix = "{0}_".format(self.__class__.__name__) + self.tmp_dir = tempfile.mkdtemp(prefix=prefix) self.test_file = 'test_file' + conf.get_autoupdate_enabled = Mock(return_value=True) conf.get_lib_dir = Mock(return_value=self.tmp_dir) + ext_log_dir = os.path.join(self.tmp_dir, "azure") conf.get_ext_log_dir = Mock(return_value=ext_log_dir) + conf.get_agent_pid_file_path = Mock(return_value=os.path.join(self.tmp_dir, "waagent.pid")) + event.init_event_status(self.tmp_dir) + event.init_event_logger(self.tmp_dir) + def tearDown(self): if not debug and self.tmp_dir is not None: shutil.rmtree(self.tmp_dir) -- cgit v1.2.3