コード例 #1
0
ファイル: test_base.py プロジェクト: mxr/nsq-py
 def setUp(self):
     self.socket = mock.Mock()
     self.wrapped = SocketWrapper.wrap_socket(self.socket)
コード例 #2
0
ファイル: test_base.py プロジェクト: dlecocq/nsq-py
 def setUp(self):
     self.socket = mock.Mock()
     self.wrapped = SocketWrapper.wrap_socket(self.socket)
コード例 #3
0
ファイル: test_base.py プロジェクト: mxr/nsq-py
 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')
コード例 #4
0
ファイル: test_base.py プロジェクト: dlecocq/nsq-py
 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')