fix tests
This commit is contained in:
@@ -70,11 +70,13 @@ class TestAnimeServiceInitialization:
|
||||
bad_series_app = MagicMock()
|
||||
bad_series_app.directory_to_search = str(tmp_path)
|
||||
|
||||
# Make event subscription fail
|
||||
def raise_error(*args):
|
||||
raise Exception("Initialization failed")
|
||||
|
||||
bad_series_app.__setattr__ = raise_error
|
||||
# Make event subscription fail by raising on property access
|
||||
type(bad_series_app).download_status = property(
|
||||
lambda self: None,
|
||||
lambda self, value: (_ for _ in ()).throw(
|
||||
Exception("Initialization failed")
|
||||
)
|
||||
)
|
||||
|
||||
with pytest.raises(
|
||||
AnimeServiceError, match="Initialization failed"
|
||||
|
||||
Reference in New Issue
Block a user