MCPcopy Create free account
hub / github.com/sshuttle/sshuttle / test_notify_sendto_error

Function test_notify_sendto_error

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

Source from the content-addressed store, hash-verified

34@patch('sshuttle.sdnotify.socket.socket')
35@patch('sshuttle.sdnotify.os.environ.get')
36def test_notify_sendto_error(mock_get, mock_socket):
37 message = sshuttle.sdnotify.ready()
38 socket_path = '/run/valid_path'
39
40 sock = Mock()
41 sock.sendto.side_effect = socket.error('test error')
42 mock_get.return_value = '/run/valid_path'
43 mock_socket.return_value = sock
44
45 assert not sshuttle.sdnotify.send(message)
46 assert sock.sendto.mock_calls == [
47 call(message, socket_path),
48 ]
49
50
51@patch('sshuttle.sdnotify.socket.socket')

Callers

nothing calls this directly

Calls 1

sendMethod · 0.45

Tested by

no test coverage detected