Merge "mock out the guestagent write_file call"

This commit is contained in:
Jenkins 2015-12-29 21:01:38 +00:00 committed by Gerrit Code Review
commit 2662c998a0
2 changed files with 5 additions and 2 deletions

View File

@ -1870,7 +1870,8 @@ class BaseDbStatusTest(testtools.TestCase):
InstanceServiceStatus.find_by(instance_id=self.FAKE_ID).delete()
dbaas.CONF.guest_id = None
def test_begin_install(self):
@patch.object(operating_system, 'write_file')
def test_begin_install(self, mock_write_file):
base_db_status = BaseDbStatus()
base_db_status.begin_install()

View File

@ -19,6 +19,7 @@ from testtools.matchers import Is
from trove.common.context import TroveContext
from trove.common.exception import DatastoreOperationNotSupported
from trove.common import instance as rd_instance
from trove.guestagent.common import operating_system
from trove.guestagent.datastore.experimental.vertica.manager import Manager
from trove.guestagent.datastore.experimental.vertica.service import (
VerticaAppStatus)
@ -251,7 +252,8 @@ class GuestAgentManagerTest(trove_testtools.TestCase):
test_resize_fs = volume.VolumeDevice.resize_fs.call_args_list[0]
test_resize_fs.assert_called_with('/var/lib/vertica')
def test_cluster_complete(self):
@patch.object(operating_system, 'write_file')
def test_cluster_complete(self, mock_write_file):
mock_set_status = MagicMock()
self.manager.appStatus.set_status = mock_set_status
self.manager.appStatus._get_actual_db_status = MagicMock(