Skip to content

Commit

Permalink
added default_mapping test
Browse files Browse the repository at this point in the history
Corrected the previous issue, now just checking how many instances of map appears in default_mapping
Not sure if this is the best solution, advice requested
  • Loading branch information
Daniel Zhou committed Jun 26, 2023
1 parent e51a109 commit 16b068f
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions tests/cleaner_tests/full_report/full_report_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,12 @@ def pre_sos_setup(self):
def test_default_mapping(self):
self.assertFileExists('/etc/sos/cleaner/default_mapping')
self.assertOutputContains('Wrote mapping to')
with open('default_mapping') as ref:
with open('/etc/sos/cleaner/default_mapping') as ref:
ref_data = ref.read()
actual_data = None
with open(self.files[0][1]) as actual:
actual_data = actual.read()
if actual_data != ref_data:
assert False
else:
assert True
map_count = ref_data.count("map")
if map_count == 0:
assert(False)
assert True

def test_private_map_was_generated(self):
self.assertOutputContains('A mapping of obfuscated elements is available at')
Expand Down

0 comments on commit 16b068f

Please sign in to comment.