aboutsummaryrefslogtreecommitdiffstats
path: root/tests/report_tests
diff options
context:
space:
mode:
authorArif Ali <arif.ali@canonical.com>2024-04-18 12:54:50 +0100
committerJake Hunsaker <jacob.r.hunsaker@gmail.com>2024-05-02 10:47:52 -0400
commit799425b80267fe215f9b9191348c8032deec013c (patch)
treed77e3f715d9c6eaaf67396c5d0534918971a26b1 /tests/report_tests
parent5a2091c1b0d85c15d01c22e40752950a1a6cd464 (diff)
downloadsos-799425b80267fe215f9b9191348c8032deec013c.tar.gz
[pylint] Convert all tests to f-strings
Signed-off-by: Arif Ali <arif.ali@canonical.com>
Diffstat (limited to 'tests/report_tests')
-rw-r--r--tests/report_tests/encryption_tests.py6
-rw-r--r--tests/report_tests/help_output_tests.py2
-rw-r--r--tests/report_tests/plugin_tests/networking/networking.py2
-rw-r--r--tests/report_tests/smoke_tests.py4
4 files changed, 7 insertions, 7 deletions
diff --git a/tests/report_tests/encryption_tests.py b/tests/report_tests/encryption_tests.py
index 64b01fde..c18398a8 100644
--- a/tests/report_tests/encryption_tests.py
+++ b/tests/report_tests/encryption_tests.py
@@ -19,11 +19,11 @@ class EncryptedReportTest(StageOneReportTest):
"""
encrypt_pass = 'sostest'
- sos_cmd = "-o kernel --encrypt-pass %s" % encrypt_pass
+ sos_cmd = f"-o kernel --encrypt-pass {encrypt_pass}"
def test_archive_gpg_encrypted(self):
self.assertOutputContains(r'/.*sosreport-.*tar.*\.gpg')
- _cmd = "file %s" % self.encrypted_path
+ _cmd = f"file {self.encrypted_path}"
res = process.run(_cmd)
self.assertTrue(
("GPG symmetrically encrypted data" in res.stdout.decode())
@@ -41,7 +41,7 @@ class EncryptedCleanedReportTest(EncryptedReportTest):
"""
encrypt_pass = 'sostest'
- sos_cmd = "-o host,networking --clean --encrypt-pass %s" % encrypt_pass
+ sos_cmd = f"-o host,networking --clean --encrypt-pass {encrypt_pass}"
def test_hostname_obfuscated(self):
self.assertFileHasContent('hostname', 'host0')
diff --git a/tests/report_tests/help_output_tests.py b/tests/report_tests/help_output_tests.py
index 8321f193..e6cf393f 100644
--- a/tests/report_tests/help_output_tests.py
+++ b/tests/report_tests/help_output_tests.py
@@ -48,4 +48,4 @@ class ReportListPluginsTest(StageOneOutputTest):
# Ignore newlines
if not ln:
continue
- assert len(ln) > 1, "Plugin '%s' missing description" % ln[0]
+ assert len(ln) > 1, f"Plugin '{ln[0]}' missing description"
diff --git a/tests/report_tests/plugin_tests/networking/networking.py b/tests/report_tests/plugin_tests/networking/networking.py
index 77afe6d5..3b15bc88 100644
--- a/tests/report_tests/plugin_tests/networking/networking.py
+++ b/tests/report_tests/plugin_tests/networking/networking.py
@@ -37,7 +37,7 @@ class NetworkingPluginTest(StageOneReportTest):
# https://lwn.net/Articles/142330/
if not dev.startswith('bonding_'):
self.assertFileGlobInArchive(
- "sos_commands/networking/ethtool_*_%s" % dev
+ f"sos_commands/networking/ethtool_*_{dev}"
)
diff --git a/tests/report_tests/smoke_tests.py b/tests/report_tests/smoke_tests.py
index 593e9a0c..94bf10b2 100644
--- a/tests/report_tests/smoke_tests.py
+++ b/tests/report_tests/smoke_tests.py
@@ -27,7 +27,7 @@ class AllPluginSmokeTest(StageOneReportTest):
"""
def pre_sos_setup(self):
- _cmd = '%s report --list-plugins' % self.sos_bin
+ _cmd = f'{self.sos_bin} report --list-plugins'
out = process.run(_cmd, timeout=300).stdout.decode()
reg = DISABLED + '(.*?)' + OPTIONS
self.plugs = []
@@ -38,7 +38,7 @@ class AllPluginSmokeTest(StageOneReportTest):
except Exception:
pass
- self.sos_cmd = '-e %s' % ','.join(p for p in self.plugs)
+ self.sos_cmd = f'-e {",".join(p for p in self.plugs)}'
def test_all_plugins_ran(self):
for plugin in self.plugs: