diff options
author | Barry Warsaw <barry@python.org> | 2015-01-22 11:38:51 -0500 |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 2015-01-22 11:38:51 -0500 |
commit | 6363b546c8bacb24b9350d108165a09bb65828a1 (patch) | |
tree | ea14c3bb4fc2915c9ad183b9a3ed21c93b11b3dc /tests/unittests/helpers.py | |
parent | f895cb12141281702b34da18f2384deb64c881e7 (diff) | |
download | vyos-cloud-init-6363b546c8bacb24b9350d108165a09bb65828a1.tar.gz vyos-cloud-init-6363b546c8bacb24b9350d108165a09bb65828a1.zip |
Port test__init__.py to unittest.mock.
Diffstat (limited to 'tests/unittests/helpers.py')
-rw-r--r-- | tests/unittests/helpers.py | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/tests/unittests/helpers.py b/tests/unittests/helpers.py index 52305397..4ca460f1 100644 --- a/tests/unittests/helpers.py +++ b/tests/unittests/helpers.py @@ -2,11 +2,6 @@ import os import sys import unittest -from contextlib import contextmanager - -from mocker import Mocker -from mocker import MockerTestCase - from cloudinit import helpers as ch from cloudinit import util @@ -86,17 +81,6 @@ else: pass -@contextmanager -def mocker(verify_calls=True): - m = Mocker() - try: - yield m - finally: - m.restore() - if verify_calls: - m.verify() - - # Makes the old path start # with new base instead of whatever # it previously had @@ -126,9 +110,8 @@ def retarget_many_wrapper(new_base, am, old_func): return wrapper -class ResourceUsingTestCase(MockerTestCase): +class ResourceUsingTestCase(unittest.TestCase): def __init__(self, methodName="runTest"): - MockerTestCase.__init__(self, methodName) self.resource_path = None def resourceLocation(self, subname=None): |