Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/tests/test_retry.py
Show All 29 Lines | def monkeypatch_sleep(monkeypatch, swh_storage): | ||||
for method_name, method in RetryingProxyStorage.__dict__.items(): | for method_name, method in RetryingProxyStorage.__dict__.items(): | ||||
if "_add" in method_name or "_update" in method_name: | if "_add" in method_name or "_update" in method_name: | ||||
monkeypatch.setattr(method.retry, "sleep", lambda x: None) | monkeypatch.setattr(method.retry, "sleep", lambda x: None) | ||||
return monkeypatch | return monkeypatch | ||||
@pytest.fixture | @pytest.fixture | ||||
def fake_hash_collision(sample_data): | def fake_hash_collision(sample_data_model): | ||||
return HashCollision("sha1", "38762cf7f55934b34d179ae6a4c80cadccbb7f0a", []) | return HashCollision("sha1", "38762cf7f55934b34d179ae6a4c80cadccbb7f0a", []) | ||||
@pytest.fixture | @pytest.fixture | ||||
def swh_storage_backend_config(): | def swh_storage_backend_config(): | ||||
yield { | yield { | ||||
"cls": "pipeline", | "cls": "pipeline", | ||||
"steps": [{"cls": "retry"}, {"cls": "memory"},], | "steps": [{"cls": "retry"}, {"cls": "memory"},], | ||||
▲ Show 20 Lines • Show All 790 Lines • Show Last 20 Lines |