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:
parent
2b4e90d8ed
commit
be26dc7adc
@ -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
4
cloudinit/tests/util.py
Normal file
@ -0,0 +1,4 @@
|
||||
try:
|
||||
from unittest import mock
|
||||
except ImportError:
|
||||
import mock # noqa
|
Loading…
x
Reference in New Issue
Block a user