

def test_load_processes_events_until_loaded(self, is_loaded_mock, time_mock):
    is_loaded_mock.side_effect = [False, False, False, False, False, True]
    time_mock.time.side_effect = time.time
    foo = Foo(is_loaded_mock.session)
    foo.load()
    self.assertEqual(self.session.process_events.call_count, 2)
    self.assertEqual(time_mock.sleep.call_count, 2)

dataset/ETHPy150Open mopidy/pyspotify/tests/test_loadable.py LoadableTest.test_load_processes_events_until_loaded/VarMisuse@46/69 `self`->`is_loaded_mock`