[master 1/3] Get rid of pointless test case about arguments for labeling apps.
mulkieran
installerbot-noreply at redhat.com
Wed May 27 20:03:08 UTC 2015
From: mulhern <amulhern at redhat.com>
Related: #130
It breaks when not all supporting apps are available with a KeyError.
It used to be kind of useful to make sure that the flags for the
different filesystem apps hadn't been jumbled around. It was
probably kind of useful to detect regressions.
But now that tasks branch is committed, it serves no useful purpose.
The tasks for fswritelabel module are a whole lot clearer than the tests.
And the other tests for the formats do a better job of checking for
correctness.
Signed-off-by: mulhern <amulhern at redhat.com>
---
tests/formats_test/labeling_test.py | 34 ----------------------------------
1 file changed, 34 deletions(-)
diff --git a/tests/formats_test/labeling_test.py b/tests/formats_test/labeling_test.py
index 4f69e81..6d167f1 100755
--- a/tests/formats_test/labeling_test.py
+++ b/tests/formats_test/labeling_test.py
@@ -56,40 +56,6 @@ def testLabels(self):
for _k, v in device_formats.items():
self.assertIsNotNone(v(label=None))
-class MethodsTestCase(unittest.TestCase):
- """Test some methods that do not require actual images."""
-
- def setUp(self):
- self.fs = {}
- for k, v in device_formats.items():
- if issubclass(v, fs.FS) and v().labeling():
- self.fs[k] = v(device="/dev", label="myfs")
-
-
- def testGetLabelArgs(self):
- self.longMessage = True
-
- # ReiserFS uses a -l flag
- reiserfs = self.fs["reiserfs"]
- self.assertEqual(reiserfs._writelabel._setCommand,
- ["reiserfstune", "-l", "myfs", "/dev"], msg="reiserfs")
-
- # JFS, XFS use a -L flag
- lflag_classes = [fs.JFS, fs.XFS]
- for name, klass in [(k, v) for k, v in self.fs.items() if any(isinstance(v, c) for c in lflag_classes)]:
- self.assertEqual(klass._writelabel._setCommand, [str(klass._writelabel.ext), "-L", "myfs", "/dev"], msg=name)
-
- # Ext2FS and descendants and FATFS do not use a flag
- noflag_classes = [fs.Ext2FS, fs.FATFS]
- for name, klass in [(k, v) for k, v in self.fs.items() if any(isinstance(v, c) for c in noflag_classes)]:
- self.assertEqual(klass._writelabel._setCommand, [str(klass._writelabel.ext), "/dev", "myfs"], msg=name)
-
- # all of the remaining are non-labeling so will accept any label
- label = "Houston, we have a problem!"
- for name, klass in device_formats.items():
- if issubclass(klass, fs.FS) and not klass().labeling() and not issubclass(klass, fs.NFS):
- self.assertEqual(klass(device="/dev", label=label).label, label, msg=name)
-
class XFSTestCase(fslabeling.CompleteLabelingAsRoot):
_fs_class = fs.XFS
_invalid_label = "root filesystem"
--
To view this commit on github, visit https://github.com/rhinstaller/blivet/commit/291ef2bc03001efca59ad6e2a13df7a46f0055f7
More information about the anaconda-patches
mailing list