diff options
author | Ćukasz 'sil2100' Zemczak <lukasz.zemczak@ubuntu.com> | 2017-09-04 10:27:07 +0200 |
---|---|---|
committer | usd-importer <ubuntu-server@lists.ubuntu.com> | 2017-09-04 09:38:24 +0000 |
commit | e919bdd14e48919244da9e499070fb64377993e5 (patch) | |
tree | 33c260c7c99410ac94d5f265fc506cc0b40bb6e4 /tests/tools.py | |
parent | 70c0ea1ac879b2e1cba0a8edb1f3fbe82652413b (diff) | |
parent | 3a1d96a77ccaf023256d16183428e3d895f8a051 (diff) | |
download | vyos-walinuxagent-e919bdd14e48919244da9e499070fb64377993e5.tar.gz vyos-walinuxagent-e919bdd14e48919244da9e499070fb64377993e5.zip |
Import patches-applied version 2.2.16-0ubuntu1 to applied/ubuntu/artful-proposed
Imported using git-ubuntu import.
Changelog parent: 70c0ea1ac879b2e1cba0a8edb1f3fbe82652413b
Unapplied parent: 3a1d96a77ccaf023256d16183428e3d895f8a051
New changelog entries:
* New upstream release (LP: #1714299).
Diffstat (limited to 'tests/tools.py')
-rw-r--r-- | tests/tools.py | 9 |
1 files changed, 9 insertions, 0 deletions
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) |