Here are the examples of the python api mock.sentinel.pidfile taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
1 Examples
0
Example 1
Project: compoundpi Source File: test_server.py
def test_server_init():
daemon_mock.runner.make_pidlockfile.return_value = sentinel.pidfile
daemon_mock.runner.is_pidfile_stale.return_value = False
with patch.object(daemon_mock, 'DaemonContext') as ctx:
ctx.__enter__ = Mock()
ctx.__exit__ = Mock()
with patch('compoundpi.server.CompoundPiUDPServer') as srv:
app = compoundpi.server.CompoundPiServer()
app([])
ctx.assert_called_once_with(
detach_process=False,
stderr=sys.stderr,
uid=os.getuid(),
gid=os.getgid(),
files_preserve=[app.server.socket],
pidfile=sentinel.pidfile,
signal_map={
signal.SIGTERM: app.terminate,
signal.SIGINT: app.interrupt,
})
app.server.serve_forever.assert_called_once_with()