Skip to content

Commit

Permalink
fix test_grub
Browse files Browse the repository at this point in the history
  • Loading branch information
Bodong-Yang committed Sep 22, 2023
1 parent ebb0c4c commit ccf67cc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/test_boot_control/test_grub.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def mock_setup(
mocker: pytest_mock.MockerFixture,
grub_ab_slot,
):
from otaclient.app.boot_control._grub import GrubABPartitionDetecter
from otaclient.app.boot_control._grub import GrubABPartitionDetector
from otaclient.app.boot_control._common import CMDHelperFuncs, SlotMountHelper

# ------ start fsm ------ #
Expand All @@ -244,7 +244,7 @@ def mock_setup(
)

# ------ mock GrubABPartitionDetector ------ #
_mocked_ab_partition_detector = mocker.MagicMock(spec=GrubABPartitionDetecter)
_mocked_ab_partition_detector = mocker.MagicMock(spec=GrubABPartitionDetector)
type(_mocked_ab_partition_detector).active_slot = mocker.PropertyMock(
wraps=self._fsm.get_active_slot
)
Expand Down Expand Up @@ -293,12 +293,12 @@ def mock_setup(
_CMDHelper_at_grub_path = f"{cfg.GRUB_MODULE_PATH}.CMDHelperFuncs"
mocker.patch(_CMDHelper_at_common_path, _CMDHelper_mock)
mocker.patch(_CMDHelper_at_grub_path, _CMDHelper_mock)
# patch _GrubABPartitionDetecter
_GrubABPartitionDetecter_path = (
f"{cfg.GRUB_MODULE_PATH}.GrubABPartitionDetecter"
# patch _GrubABPartitionDetector
_GrubABPartitionDetector_path = (
f"{cfg.GRUB_MODULE_PATH}.GrubABPartitionDetector"
)
mocker.patch(
_GrubABPartitionDetecter_path, return_value=_mocked_ab_partition_detector
_GrubABPartitionDetector_path, return_value=_mocked_ab_partition_detector
)
# patch SlotMountHelper
_SlotMountHelper_path = f"{cfg.GRUB_MODULE_PATH}.SlotMountHelper"
Expand Down

0 comments on commit ccf67cc

Please sign in to comment.