Mock out fileutils entirely in the driver tests

Change-Id: Ief7715e1f77f758b5be0791683143ad21a179fb1
This commit is contained in:
Paul Hummer
2016-09-14 10:57:02 -06:00
parent 4c93aab04c
commit b9152b65e5

View File

@@ -78,6 +78,10 @@ class LXDDriverTest(test.NoDBTestCase):
self.CONF.instances_path = '/path/to/instances'
self.CONF.my_ip = '0.0.0.0'
# NOTE: mock out fileutils to ensure that unit tests don't try
# to manipulate the filesystem (breaks in package builds).
driver.fileutils = mock.Mock()
def tearDown(self):
super(LXDDriverTest, self).tearDown()
self.Client_patcher.stop()
@@ -145,10 +149,6 @@ class LXDDriverTest(test.NoDBTestCase):
network_info = [mock.Mock()]
block_device_info = mock.Mock()
# NOTE: mock out fileutils to ensure that unit tests don't try
# to manipulate the filesystem (breaks in package builds).
driver.fileutils = mock.Mock()
lxd_driver = driver.LXDDriver(None)
lxd_driver.init_host(None)
# XXX: rockstar (6 Jul 2016) - There are a number of XXX comments