Merge pull request #15992 from rallytime/bp-15617

Backport #15617 to 2014.7
This commit is contained in:
Thomas S Hatch 2014-09-19 21:41:29 -06:00
commit 3fe53840c0

View File

@ -37,9 +37,9 @@ class MdadmTestCase(TestCase):
) )
self.assertEqual('salt', ret) self.assertEqual('salt', ret)
mock.assert_called_once_with( mock.assert_called_once_with(
'mdadm -C /dev/md0 -v --chunk=256 --force -l 5 -n 3 ' ['mdadm', '-C', '/dev/md0', '-v', '--chunk', 256, '--force',
'/dev/sdb1 /dev/sdc1 /dev/sdd1' '-l', 5, '-e', 'default', '-n', 3, '/dev/sdb1', '/dev/sdc1',
) '/dev/sdd1'], python_shell=False)
def test_create_test_mode(self): def test_create_test_mode(self):
mock = MagicMock() mock = MagicMock()
@ -53,8 +53,9 @@ class MdadmTestCase(TestCase):
chunk=256, chunk=256,
test_mode=True test_mode=True
) )
self.assertEqual('mdadm -C /dev/md0 -v --chunk=256 --force -l 5 -n 3 ' self.assertEqual(['mdadm', '-C', '/dev/md0', '-v', '--chunk', 256,
'/dev/sdb1 /dev/sdc1 /dev/sdd1', ret) '--force', '-l', 5, '-e', 'default', '-n', 3,
'/dev/sdb1', '/dev/sdc1', '/dev/sdd1'], ret)
assert not mock.called, 'test mode failed, cmd.run called' assert not mock.called, 'test mode failed, cmd.run called'
if __name__ == '__main__': if __name__ == '__main__':