Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions tests/feature_activation/test_bit_signaling_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
from unittest.mock import Mock

import pytest
from structlog.testing import capture_logs

from hathor.feature_activation.bit_signaling_service import BitSignalingService
from hathor.feature_activation.feature import Feature
Expand Down Expand Up @@ -272,17 +271,15 @@ def get_bits_description_mock(block):
support_features=support_features,
not_support_features=not_support_features,
)
logger_mock = Mock()
service._log = logger_mock

with capture_logs() as logs:
service.start()
service.start()

expected_log = dict(
log_level='warning',
logger_mock.warn.assert_called_with(
'Considering the current best block, there are signaled features outside their signaling period. '
'Therefore, signaling for them has no effect. Make sure you are signaling for the desired features.',
best_block_height=123,
best_block_hash='abc',
non_signaling_features=non_signaling_features,
event='Considering the current best block, there are signaled features outside their signaling period. '
'Therefore, signaling for them has no effect. Make sure you are signaling for the desired features.',
)

assert expected_log in logs