Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pr-watson committed Jul 3, 2024
1 parent 5fd01d5 commit e30a880
Showing 1 changed file with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def test_fix_invalid_grub2_entries(self, caplog, monkeypatch, fix_invalid_grub2_
level="WARNING",
id="UNABLE_TO_GET_GRUB2_BOOT_LOADER_ENTRY",
title="Unable to get the GRUB2 boot loader entry",
description="Couldn't get the default GRUB2 boot loader entry:\nboot loader",
description="Couldn't get the default GRUB2 boot loader entry:\nbootloader",
diagnosis=None,
remediations=None,
),
Expand All @@ -277,7 +277,7 @@ def test_fix_invalid_grub2_entries(self, caplog, monkeypatch, fix_invalid_grub2_
level="WARNING",
id="UNABLE_TO_SET_GRUB2_BOOT_LOADER_ENTRY",
title="Unable to set the GRUB2 boot loader entry",
description="Couldn't set the default GRUB2 boot loader entry:\ngrep: /boot/grub2/grubenv: Permission denied\nThe param boot loader is incorrect\n",
description="Couldn't set the default GRUB2 boot loader entry:\nbootloader",
diagnosis=None,
remediations=None,
),
Expand Down Expand Up @@ -316,17 +316,20 @@ def test_fix_invalid_grub2_entries_messages(
"--default-kernel",
),
(
"boot loader",
"bootloader",
return_code_1,
),
),
(
"/usr/sbin/grubby",
"--set-default",
),
(
"boot loader",
return_code_2,
(
"/usr/sbin/grubby",
"--set-default",
"bootloader",
),
(
"bootloader",
return_code_2,
),
),
),
)
Expand All @@ -338,6 +341,8 @@ def test_fix_invalid_grub2_entries_messages(
)

fix_invalid_grub2_entries_instance.run()
print("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
print(fix_invalid_grub2_entries_instance.messages)
assert expected.issuperset(fix_invalid_grub2_entries_instance.messages)
assert expected.issubset(fix_invalid_grub2_entries_instance.messages)

Expand Down

0 comments on commit e30a880

Please sign in to comment.