def setUp(self): self.socket = mock.Mock() self.wrapped = SocketWrapper.wrap_socket(self.socket)
def test_wrap_socket(self): '''Passes through objects to the constructor''' with mock.patch.object(SocketWrapper, '__init__') as mock_init: mock_init.return_value = None SocketWrapper.wrap_socket(5, hello='foo') mock_init.assert_called_with(5, hello='foo')