Skip to content

Commit

Permalink
tests: add mock
Browse files Browse the repository at this point in the history
  • Loading branch information
vgorkavenko committed Jan 9, 2025
1 parent 9c9bb59 commit 8e1c663
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/modules/accounting/bunker/test_bunker.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def test_true_when_cl_rebase_is_negative(
is_high_midterm_slashing_penalty: Mock,
) -> None:
bunker.w3.lido_contracts.get_accounting_last_processing_ref_slot = Mock(return_value=ref_blockstamp)
bunker.w3.cc.get_config_spec = Mock()
bunker.get_cl_rebase_for_current_report = Mock(return_value=-1)

result = bunker.is_bunker_mode(
Expand Down Expand Up @@ -79,6 +80,7 @@ def test_true_when_high_midterm_slashing_penalty(
is_abnormal_cl_rebase: Mock,
) -> None:
bunker.w3.lido_contracts.get_accounting_last_processing_ref_slot = Mock(return_value=ref_blockstamp)
bunker.w3.cc.get_config_spec = Mock()
bunker.get_cl_rebase_for_current_report = Mock(return_value=0)
is_high_midterm_slashing_penalty.return_value = True
result = bunker.is_bunker_mode(
Expand All @@ -105,6 +107,7 @@ def test_true_when_abnormal_cl_rebase(
is_abnormal_cl_rebase: Mock,
) -> None:
bunker.w3.lido_contracts.get_accounting_last_processing_ref_slot = Mock(return_value=ref_blockstamp)
bunker.w3.cc.get_config_spec = Mock()
bunker.get_cl_rebase_for_current_report = Mock(return_value=0)
is_high_midterm_slashing_penalty.return_value = False
is_abnormal_cl_rebase.return_value = True
Expand Down Expand Up @@ -133,6 +136,7 @@ def test_no_bunker_mode_by_default(
is_abnormal_cl_rebase: Mock,
) -> None:
bunker.w3.lido_contracts.get_accounting_last_processing_ref_slot = Mock(return_value=ref_blockstamp)
bunker.w3.cc.get_config_spec = Mock()
bunker.get_cl_rebase_for_current_report = Mock(return_value=0)
is_high_midterm_slashing_penalty.return_value = False
is_abnormal_cl_rebase.return_value = False
Expand Down

0 comments on commit 8e1c663

Please sign in to comment.