MCPcopy Index your code
hub / github.com/sshuttle/sshuttle / test_notify

Function test_notify

tests/client/test_sdnotify.py:53–65  ·  view source on GitHub ↗
(mock_get, mock_socket)

Source from the content-addressed store, hash-verified

51@patch('sshuttle.sdnotify.socket.socket')
52@patch('sshuttle.sdnotify.os.environ.get')
53def test_notify(mock_get, mock_socket):
54 messages = [sshuttle.sdnotify.ready(), sshuttle.sdnotify.status('Running')]
55 socket_path = '/run/valid_path'
56
57 sock = Mock()
58 sock.sendto.return_value = 1
59 mock_get.return_value = '/run/valid_path'
60 mock_socket.return_value = sock
61
62 assert sshuttle.sdnotify.send(*messages)
63 assert sock.sendto.mock_calls == [
64 call(b'\n'.join(messages), socket_path),
65 ]

Callers

nothing calls this directly

Calls 1

sendMethod · 0.45

Tested by

no test coverage detected