def test_ignore_keyboard_interrupt(self, monkeypatch): my_action = tools.LongRunning('') class FakeRaiseInterruptProcess(object): def __init__(self, *args, **kwargs): pass def wait(self): raise KeyboardInterrupt() monkeypatch.setattr(tools.subprocess, 'Popen', FakeRaiseInterruptProcess) got = my_action.execute() assert got is None
def test_success(self): TEST_PATH = os.path.dirname(__file__) PROGRAM = "python %s/sample_process.py" % TEST_PATH my_action = tools.LongRunning(PROGRAM + " please fail") got = my_action.execute() assert got is None