From: Alfredo Deza Date: Thu, 1 Feb 2018 20:51:12 +0000 (-0500) Subject: ceph-volume tests add a stub for process.call X-Git-Tag: v13.0.2~330^2~22 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b80b61b90f8539b363c03c96e63f31c38c707fc8;p=ceph.git ceph-volume tests add a stub for process.call Signed-off-by: Alfredo Deza --- diff --git a/src/ceph-volume/ceph_volume/tests/conftest.py b/src/ceph-volume/ceph_volume/tests/conftest.py index 84b8a7dc77553..779cc1c018bba 100644 --- a/src/ceph-volume/ceph_volume/tests/conftest.py +++ b/src/ceph-volume/ceph_volume/tests/conftest.py @@ -46,6 +46,19 @@ def fake_call(monkeypatch): return fake_call +@pytest.fixture +def stub_call(monkeypatch): + """ + Monkeypatches process.call, so that a caller can add behavior to the response + """ + def apply(return_value): + monkeypatch.setattr( + 'ceph_volume.process.call', + lambda *a, **kw: return_value) + + return apply + + @pytest.fixture def conf_ceph(monkeypatch): """