Add cloudinit.tests.util for shared testing code.

Starting with keeping the try/except to find mock on both Python 2 and
Python 3 in one place.

Change-Id: I4fa5e6e3f6610f6eb2601d4c3cb51d76565dd3c0
This commit is contained in:
Daniel Watkins 2015-06-05 17:59:42 +01:00
parent 2b4e90d8ed
commit be26dc7adc
2 changed files with 5 additions and 5 deletions

View File

@ -15,12 +15,8 @@
import unittest
try:
import unittest.mock as mock
except ImportError:
import mock
from cloudinit.osys import base
from cloudinit.tests.util import mock
class TestOSUtils(unittest.TestCase):

4
cloudinit/tests/util.py Normal file
View File

@ -0,0 +1,4 @@
try:
from unittest import mock
except ImportError:
import mock # noqa