]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume tests add a stub for process.call
authorAlfredo Deza <adeza@redhat.com>
Thu, 1 Feb 2018 20:51:12 +0000 (15:51 -0500)
committerAlfredo Deza <adeza@redhat.com>
Thu, 1 Feb 2018 20:53:35 +0000 (15:53 -0500)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
src/ceph-volume/ceph_volume/tests/conftest.py

index 84b8a7dc77553945372742be8148e4e82dffe404..779cc1c018bba9a83887d61d14128b244e0261ba 100644 (file)
@@ -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):
     """