summaryrefslogtreecommitdiff
path: root/tests/unittests/helpers.py
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2015-01-22 11:38:51 -0500
committerBarry Warsaw <barry@python.org>2015-01-22 11:38:51 -0500
commit6363b546c8bacb24b9350d108165a09bb65828a1 (patch)
treeea14c3bb4fc2915c9ad183b9a3ed21c93b11b3dc /tests/unittests/helpers.py
parentf895cb12141281702b34da18f2384deb64c881e7 (diff)
downloadvyos-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.py19
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):