Skip to content

Commit

Permalink
el9toel10: mysql: fix tests and syntax errors
Browse files Browse the repository at this point in the history
  • Loading branch information
SlouchyButton authored and pirat89 committed Feb 12, 2025
1 parent 85ca9ca commit dfaf855
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def _generate_deprecated_config_report(found_options: list,
reporting.RelatedResource('file', '/etc/systemd/system/mysqld.service.d/override.conf'),
reporting.Remediation(hint=(
'To ensure smooth upgrade process it is strongly recommended to:{}'
.format(''.join(''._formatted_list_output(remedy_list)))
.format(''.join(_formatted_list_output(remedy_list)))
)),
])

Expand All @@ -120,8 +120,8 @@ def _generate_report(found_options: list, found_arguments: list) -> None:

if found_arguments or found_options:
_generate_deprecated_config_report(found_options, found_arguments)
else:
_generate_mysql_present_report()

_generate_mysql_present_report()


def process() -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,6 @@ def consume_mocked(*args, **kwargs):
# Check that we have made a report
assert len(reporting.create_report.reports) == 1

r = _find_hint(reporting.create_report.reports[0])

# Check that Hint was in the report
assert r is not None

assert ('Following incompatible configuration options'
not in r)


def test_process_deprecated(monkeypatch):
def consume_mocked(*args, **kwargs):
Expand All @@ -80,10 +72,18 @@ def consume_mocked(*args, **kwargs):
checkmysql.process()

# Check that we have made a report
assert len(reporting.create_report.reports) == 1
assert len(reporting.create_report.reports) == 2

# Find deprecation report
found = None
for rep in reporting.create_report.reports:
if rep['title'] == 'Detected incompatible MySQL configuration':
found = rep
break

assert found is not None

# Find first hint message in remediations
r = _find_hint(reporting.create_report.reports[0])
r = found['summary']

# Check that Hint was in the report
assert r is not None
Expand Down

0 comments on commit dfaf855

Please sign in to comment.