Example #1
0
def test_clear_repository_helper():
    reserve_fn = MagicMock()
    reserve_fn.return_value = (0x1234)

    clear_fn = MagicMock()
    clear_fn.side_effect = [
        ERASURE_COMPLETED,
        ERASURE_IN_PROGRESS,
        ERASURE_COMPLETED,
    ]

    clear_repository_helper(reserve_fn, clear_fn)

    clear_calls = [
        call(INITIATE_ERASE, 0x1234),
        call(GET_ERASE_STATUS, 0x1234),
        call(GET_ERASE_STATUS, 0x1234),
    ]
    clear_fn.assert_has_calls(clear_calls)
    eq_(clear_fn.call_count, 3)
Example #2
0
 def clear_sdr_repository(self, retry=5):
     clear_repository_helper(self.reserve_sdr_repository,
                             self._clear_sdr_repository, retry)
Example #3
0
 def clear_sdr_repository(self, retry=5):
     clear_repository_helper(self.reserve_sdr_repository,
             self._clear_sdr_repository, retry)
Example #4
0
 def clear_sel(self, retry=5):
     clear_repository_helper(self.get_sel_reservation_id,
             self._clear_sel, retry)
Example #5
0
 def clear_sel(self, retry=5):
     clear_repository_helper(self.get_sel_reservation_id, self._clear_sel,
                             retry)