[master 20/22] Fix some small mistakes in tests using availability information.

mulkieran installerbot-noreply at redhat.com
Tue May 5 16:35:44 UTC 2015


From: mulhern <amulhern at redhat.com>

Related: #12

These showed up because fewer tests are skipped with the finer granularity.

Signed-off-by: mulhern <amulhern at redhat.com>
---
 tests/formats_test/fstesting.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/formats_test/fstesting.py b/tests/formats_test/fstesting.py
index 3740f94..5f919ca 100644
--- a/tests/formats_test/fstesting.py
+++ b/tests/formats_test/fstesting.py
@@ -50,7 +50,7 @@ def _test_sizes(self, an_fs):
         else:
             expected_size = _size
             # If the size can be obtained it will not be 0
-            if an_fs._info.implemented:
+            if not an_fs._sizeinfo.availabilityErrors:
                 self.assertNotEqual(expected_size, Size(0))
                 self.assertTrue(expected_size <= self._DEVICE_SIZE)
             # Otherwise it will be 0, assuming the device was not initialized
@@ -60,7 +60,7 @@ def _test_sizes(self, an_fs):
         self.assertEqual(an_fs.size, expected_size)
 
         # Only the resizable filesystems can figure out their current min size
-        if an_fs._resize:
+        if not an_fs._sizeinfo.availabilityErrors:
             expected_min_size = min_size
         else:
             expected_min_size = an_fs._minSize
@@ -74,7 +74,7 @@ def _test_sizes(self, an_fs):
         self.assertEqual(an_fs.currentSize, _size)
 
         # Free is the actual size - the minimum size
-        self.assertEqual(an_fs.free, _size - expected_min_size)
+        self.assertEqual(an_fs.free, max(Size(0), _size - expected_min_size))
 
         # target size is set by side-effect
         self.assertEqual(an_fs.targetSize, an_fs._targetSize)


-- 
To view this commit on github, visit https://github.com/rhinstaller/blivet/commit/1153e373f374c698b7b7e23440d58c661b14ecb7


More information about the anaconda-patches mailing list