aboutsummaryrefslogtreecommitdiffstats
path: root/tests/cleaner_tests/full_report/full_report_run.py
diff options
context:
space:
mode:
authorArif Ali <arif.ali@canonical.com>2024-01-15 18:51:04 -0800
committerJake Hunsaker <jacob.r.hunsaker@gmail.com>2024-04-12 11:50:48 -0400
commit93bcf51257ec4ce2b97c942e51e56546ce8cd0cd (patch)
treedb1e835f5de49918553281726d86f4660731313e /tests/cleaner_tests/full_report/full_report_run.py
parent4069af4bca5d20662389200f0d426d2d31f054e8 (diff)
downloadsos-93bcf51257ec4ce2b97c942e51e56546ce8cd0cd.tar.gz
[testing] Add most testing via tox.ini
Consolidate testing, so that things can be run from CLI, CI and various other means in a consistent way by using tox. * Updated all the flake8 tests in the tests folder. * Added pylint as a neutral test so that we can work on this in stages and have some collaboration on what we test and don't * The tox tests for unit, stageone, stagetwo testing makes is easier for users to know how to run tests, and not have to do things manually * Using tox for CI doesn't make sense, as that will create virtual envs and will disregard system/snap based python modules so may not work Signed-off-by: Arif Ali <arif.ali@canonical.com>
Diffstat (limited to 'tests/cleaner_tests/full_report/full_report_run.py')
-rw-r--r--tests/cleaner_tests/full_report/full_report_run.py18
1 files changed, 13 insertions, 5 deletions
diff --git a/tests/cleaner_tests/full_report/full_report_run.py b/tests/cleaner_tests/full_report/full_report_run.py
index d17287a8..b7ce0742 100644
--- a/tests/cleaner_tests/full_report/full_report_run.py
+++ b/tests/cleaner_tests/full_report/full_report_run.py
@@ -9,7 +9,6 @@
import json
import re
-from avocado.utils import process
from sos_tests import StageTwoReportTest
@@ -46,8 +45,13 @@ class FullCleanTest(StageTwoReportTest):
)
def test_private_map_was_generated(self):
- self.assertOutputContains('A mapping of obfuscated elements is available at')
- map_file = re.findall('/.*sosreport-.*-private_map', self.cmd_output.stdout)[-1]
+ self.assertOutputContains(
+ 'A mapping of obfuscated elements is available at'
+ )
+ map_file = re.findall(
+ '/.*sosreport-.*-private_map',
+ self.cmd_output.stdout
+ )[-1]
self.assertFileExists(map_file)
def test_tarball_named_obfuscated(self):
@@ -69,7 +73,10 @@ class FullCleanTest(StageTwoReportTest):
def test_no_empty_obfuscations(self):
# get the private map file name
- map_file = re.findall('/.*sosreport-.*-private_map', self.cmd_output.stdout)[-1]
+ map_file = re.findall(
+ '/.*sosreport-.*-private_map',
+ self.cmd_output.stdout
+ )[-1]
with open(map_file, 'r') as mf:
map_json = json.load(mf)
for mapping in map_json:
@@ -83,4 +90,5 @@ class FullCleanTest(StageTwoReportTest):
if not content:
assert True
else:
- self.fail("IP appears in files: %s" % "\n".join(f for f in content))
+ new_content = "\n".join(f for f in content)
+ self.fail(f'IP appears in files: {new_content}')