

def test_load_raises_error_if_offline(self, is_loaded_mock, time_mock):
    is_loaded_mock.return_value = False
    self.session.connection.state = spotify.ConnectionState.OFFLINE
    foo = Foo(self.session)
    with self.assertRaises(spotify.Error):
        foo.load()

dataset/ETHPy150Open mopidy/pyspotify/tests/test_loadable.py LoadableTest.test_load_raises_error_if_offline/original