Skip to content

Commit

Permalink
fix: review
Browse files Browse the repository at this point in the history
  • Loading branch information
vgorkavenko committed Sep 16, 2024
1 parent db4da8a commit 59c2faf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/modules/csm/csm.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def collect_data(self, blockstamp: BlockStamp) -> bool:
self.state.migrate(l_epoch, r_epoch)
self.state.log_progress()

if self.state.is_fulfilled is True:
if self.state.is_fulfilled:
logger.info({"msg": "All epochs are already processed. Nothing to collect"})
return True

Expand Down
4 changes: 2 additions & 2 deletions tests/modules/csm/test_csm_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,15 +480,15 @@ def test_collect_data_fulfilled_state(
migrate=Mock(),
log_status=Mock(),
unprocessed_epochs=list(range(0, 101)),
is_fulfilled=PropertyMock(side_effect=[False, True]),
)
type(module.state).is_fulfilled = PropertyMock(side_effect=[False, True])
module.current_frame_range = Mock(return_value=(0, 100))
module.get_blockstamp_for_report = Mock(return_value=Mock(ref_epoch=100))

with caplog.at_level(logging.DEBUG):
with patch('src.modules.csm.csm.FrameCheckpointProcessor.exec', return_value=None):
collected = module.collect_data(blockstamp=Mock(slot_number=640))
assert collected
assert collected is True

# assert that it is not early return from function
msg = list(filter(lambda log: "All epochs are already processed. Nothing to collect" in log, caplog.messages))
Expand Down

0 comments on commit 59c2faf

Please sign in to comment.