aboutsummaryrefslogtreecommitdiffstats
path: root/tests/collect_tests/help_output_tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/collect_tests/help_output_tests.py')
-rw-r--r--tests/collect_tests/help_output_tests.py39
1 files changed, 29 insertions, 10 deletions
diff --git a/tests/collect_tests/help_output_tests.py b/tests/collect_tests/help_output_tests.py
index 584ad498..4a253f56 100644
--- a/tests/collect_tests/help_output_tests.py
+++ b/tests/collect_tests/help_output_tests.py
@@ -35,13 +35,20 @@ class CollectHelpOutputTest(StageOneOutputTest):
sos_cmd = 'collect --help'
- @skipIf(PEXPECT_PRESENT, "python3-pexpect is installed, placeholder will not be used")
+ @skipIf(
+ PEXPECT_PRESENT,
+ "python3-pexpect is installed, placeholder will not be used"
+ )
def test_placeholder_warning_shown(self):
- self.assertOutputContains("WARNING: `collect` is not available with this installation!")
+ self.assertOutputContains(
+ "WARNING: `collect` is not available with this installation!"
+ )
@skipIf(PEXPECT_PRESENT is False, "python3-pexpect not installed locally")
def test_help_sections_present(self):
- self.assertOutputNotContains("WARNING: `collect` is not available with this installation!")
+ self.assertOutputNotContains(
+ "WARNING: `collect` is not available with this installation!"
+ )
self.assertOutputContains("Global Options:")
self.assertOutputContains("Report Passthru Options:")
self.assertOutputContains("Collector Options:")
@@ -65,7 +72,9 @@ class CollectOptionsHelpTest(StageOneOutputTest):
@skipIf(PEXPECT_PRESENT is False, "python3-pexpect not installed locally")
def test_cluster_profiles_shown(self):
- _out = re.search(r"Use the short name with --cluster-type or cluster options \(-c\)(.*?)The following cluster options are available:",
+ _out = re.search("Use the short name with --cluster-type or cluster "
+ r"options \(-c\)(.*?)The following cluster options "
+ "are available:",
self.cmd_output.stdout, re.S).group(1).splitlines()
_profs = {}
for ln in _out:
@@ -75,8 +84,9 @@ class CollectOptionsHelpTest(StageOneOutputTest):
_profs[ln[0]] = ln[1]
clusters = []
- # get a list of names of profile pyfiles
- for pyfile in glob.glob(os.path.join(SOS_REPO_ROOT, 'sos/collector/clusters/*.py')):
+ # get a list of names of profile pyfiles
+ for pyfile in glob.glob(os.path.join(SOS_REPO_ROOT,
+ 'sos/collector/clusters/*.py')):
pyf = os.path.basename(pyfile)
if pyf.startswith('__'):
continue
@@ -88,17 +98,26 @@ class CollectOptionsHelpTest(StageOneOutputTest):
# this has the secondary effect of enforcing a stylistic requirement
# where at least one profile must match the pyfile name
for clus in clusters:
- assert clus in _profs, "Cluster '%s' not displayed in --list-options" % clus
+ assert \
+ clus in _profs, \
+ f"Cluster '{clus}' not displayed in --list-options"
@skipIf(PEXPECT_PRESENT is False, "python3-pexpect not installed locally")
def test_cluster_options_shown(self):
- _opts = re.search(" Cluster Option Name Type Default Description(.*?)Options take the form of cluster.name=value",
+ _opts = re.search(" Cluster Option Name "
+ "Type Default Description(.*?)Options "
+ "take the form of cluster.name=value",
self.cmd_output.stdout, re.S).group(1).splitlines()
_opts = [o for o in _opts if o]
assert _opts, "No option output detected"
- @skipIf(PEXPECT_PRESENT, "python3-pexpect is installed, placeholder will be unused")
+ @skipIf(
+ PEXPECT_PRESENT,
+ "python3-pexpect is installed, placeholder will be unused"
+ )
def test_placeholder_component_used(self):
- self.assertOutputContains("(unavailable) Collect an sos report from multiple nodes")
+ self.assertOutputContains(
+ "(unavailable) Collect an sos report from multiple nodes"
+ )