@@ -416,7 +416,8 @@ def test_do_execute_scope_processing_with_usage_data(
416416 ])
417417 self .assertTrue (update_scope_processing_state_db_mock .called )
418418
419- @mock .patch ("cloudkitty.storage_state.StateManager.get_state" )
419+ @mock .patch ("cloudkitty.storage_state.StateManager"
420+ ".get_last_processed_timestamp" )
420421 @mock .patch ("cloudkitty.storage_state.StateManager"
421422 ".is_storage_scope_active" )
422423 @mock .patch ("cloudkitty.orchestrator.Worker.do_execute_scope_processing" )
@@ -438,7 +439,8 @@ def test_execute_worker_processing_no_next_timestamp(
438439 self .assertFalse (do_execute_scope_processing_mock .called )
439440 self .assertTrue (next_timestamp_to_process_mock .called )
440441
441- @mock .patch ("cloudkitty.storage_state.StateManager.get_state" )
442+ @mock .patch ("cloudkitty.storage_state.StateManager"
443+ ".get_last_processed_timestamp" )
442444 @mock .patch ("cloudkitty.storage_state.StateManager"
443445 ".is_storage_scope_active" )
444446 @mock .patch ("cloudkitty.orchestrator.Worker.do_execute_scope_processing" )
@@ -468,7 +470,8 @@ def test_execute_worker_processing_scope_not_processed_yet(
468470 self .assertFalse (state_manager_is_storage_scope_active_mock .called )
469471 self .assertTrue (next_timestamp_to_process_mock .called )
470472
471- @mock .patch ("cloudkitty.storage_state.StateManager.get_state" )
473+ @mock .patch ("cloudkitty.storage_state.StateManager"
474+ ".get_last_processed_timestamp" )
472475 @mock .patch ("cloudkitty.storage_state.StateManager"
473476 ".is_storage_scope_active" )
474477 @mock .patch ("cloudkitty.orchestrator.Worker.do_execute_scope_processing" )
@@ -503,7 +506,8 @@ def test_execute_worker_processing_scope_already_processed_active(
503506
504507 self .assertTrue (next_timestamp_to_process_mock .called )
505508
506- @mock .patch ("cloudkitty.storage_state.StateManager.get_state" )
509+ @mock .patch ("cloudkitty.storage_state.StateManager"
510+ ".get_last_processed_timestamp" )
507511 @mock .patch ("cloudkitty.storage_state.StateManager"
508512 ".is_storage_scope_active" )
509513 @mock .patch ("cloudkitty.orchestrator.Worker.do_execute_scope_processing" )
@@ -588,7 +592,8 @@ def test_check_state(self, check_time_state_mock):
588592 state_mock = mock .Mock ()
589593
590594 timestamp_now = tzutils .localized_now ()
591- state_mock ._state .get_state .return_value = timestamp_now
595+ state_mock ._state .get_last_processed_timestamp .return_value = \
596+ timestamp_now
592597
593598 expected_time = timestamp_now + datetime .timedelta (hours = 1 )
594599 check_time_state_mock .return_value = \
@@ -599,7 +604,7 @@ def test_check_state(self, check_time_state_mock):
599604
600605 self .assertEqual (expected_time , return_of_method )
601606
602- state_mock ._state .get_state .assert_has_calls ([
607+ state_mock ._state .get_last_processed_timestamp .assert_has_calls ([
603608 mock .call (self ._tenant_id )])
604609 check_time_state_mock .assert_has_calls ([
605610 mock .call (timestamp_now , 3600 , 2 )])
0 commit comments