Fixed unit test to not actually run backup command

One unit tests is still trying to execute the actual backup command
instead of the mocked backup command. This is causing an issue on
the Jenkins slave where it is trying to run as sudo (and failing).
Fixed the test to use a mock runner, and not try to run innobackupex.

This had been previously fixed by commit 19d940516e, but that fix was
clobbered by the move from mockito to mock.

Change-Id: Ib63187d4414a3ef7b7f664e076bb4d92a40c2214
Closes-bug: 1291516
This commit is contained in:
Nikhil Manchanda 2014-04-01 22:31:16 -07:00
parent 3668abcca1
commit 0e9dd94eb0
1 changed files with 3 additions and 1 deletions

View File

@ -373,7 +373,9 @@ class BackupAgentTest(testtools.TestCase):
mysql_impl.InnoBackupExIncremental.metadata = MagicMock(
return_value=meta)
mysql_impl.InnoBackupExIncremental.check_process = MagicMock(
mysql_impl.InnoBackupExIncremental.run = MagicMock(
return_value=True)
mysql_impl.InnoBackupExIncremental.__exit__ = MagicMock(
return_value=True)
agent = backupagent.BackupAgent()