def test_ensure_supervisor_started(tmpdir, monkeypatch): m = Mock() monkeypatch.setattr(subprocess, "check_call", m) tmpdir.join("supervisord.pid").write("123123") supconfig = tmpdir.join("etc", "supervisord.conf") ensure_supervisor_started(tmpdir, supconfig) m.assert_called_once()
def test_ensure_supervisor_started_exists(tmpdir, monkeypatch): m = Mock() monkeypatch.setattr(subprocess, "check_call", m) tmpdir.join("supervisord.pid").write(os.getpid()) ensure_supervisor_started(tmpdir, None) assert not m.called