From 16692ad44613b92099745bbf9b94305728e4af2a Mon Sep 17 00:00:00 2001 From: Nitin Madhok Date: Wed, 17 Dec 2014 14:27:51 -0500 Subject: [PATCH] Refactor mdadm tests --- tests/unit/modules/mdadm_test.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/tests/unit/modules/mdadm_test.py b/tests/unit/modules/mdadm_test.py index 95e537949d..7c49883500 100644 --- a/tests/unit/modules/mdadm_test.py +++ b/tests/unit/modules/mdadm_test.py @@ -28,9 +28,7 @@ class MdadmTestCase(TestCase): with patch.dict(mdadm.__salt__, {'cmd.run': mock}): ret = mdadm.create( '/dev/md0', 5, - devices="['/dev/sdb1', - '/dev/sdc1', - '/dev/sdd1']", + devices=['/dev/sdb1', '/dev/sdc1', '/dev/sdd1'], test_mode=False, force=True, chunk=256 @@ -46,16 +44,14 @@ class MdadmTestCase(TestCase): with patch.dict(mdadm.__salt__, {'cmd.run': mock}): ret = mdadm.create( '/dev/md0', 5, - devices="['/dev/sdb1', - '/dev/sdc1', - '/dev/sdd1']", + devices=['/dev/sdb1', '/dev/sdc1', '/dev/sdd1'], force=True, chunk=256, test_mode=True ) - self.assertEqual(['mdadm -C /dev/md0 -v --chunk 256 ' + self.assertEqual('mdadm -C /dev/md0 -v --chunk 256 ' '--force -l 5 -e default -n 3 ' - '/dev/sdb1 /dev/sdc1 /dev/sdd1'], ret) + '/dev/sdb1 /dev/sdc1 /dev/sdd1', ret) assert not mock.called, 'test mode failed, cmd.run called' if __name__ == '__main__':