[PATCH 1/4] Bypass size getter when mocking new devices.

David Lehman dlehman at redhat.com
Thu Jul 31 22:16:19 UTC 2014


The size getter gets the size from the partedDevice, which is not
advisable while we're in the process of mocking the partedDevice.
---
 tests/storagetestcase.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/storagetestcase.py b/tests/storagetestcase.py
index 18b6f57..11de630 100644
--- a/tests/storagetestcase.py
+++ b/tests/storagetestcase.py
@@ -66,7 +66,7 @@ class StorageTestCase(unittest.TestCase):
         if exists:
             # set up mock parted.Device w/ correct size
             device._partedDevice = Mock()
-            device._partedDevice.getLength = Mock(return_value=int(device.size.convertTo(spec="B")))
+            device._partedDevice.getLength = Mock(return_value=int(device._size.convertTo(spec="B")))
             device._partedDevice.sectorSize = 512
 
         if isinstance(device, blivet.devices.PartitionDevice):
-- 
1.9.3



More information about the anaconda-patches mailing list