Here are the examples of the python api mock.sentinel.line taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
3 Examples
3
Example 1
Project: mopidy Source File: test_lineprotocol.py
def test_on_receive_with_new_line_calls_decode(self):
self.mock.connection = Mock(spec=network.Connection)
self.mock.recv_buffer = ''
self.mock.parse_lines.return_value = [sentinel.line]
network.LineProtocol.on_receive(self.mock, {'received': 'data\n'})
self.mock.parse_lines.assert_called_once_with()
self.mock.decode.assert_called_once_with(sentinel.line)
3
Example 2
Project: mopidy Source File: test_lineprotocol.py
def test_on_receive_with_new_line_calls_on_recieve(self):
self.mock.connection = Mock(spec=network.Connection)
self.mock.recv_buffer = ''
self.mock.parse_lines.return_value = [sentinel.line]
self.mock.decode.return_value = sentinel.decoded
network.LineProtocol.on_receive(self.mock, {'received': 'data\n'})
self.mock.on_line_received.assert_called_once_with(sentinel.decoded)
3
Example 3
Project: mopidy Source File: test_lineprotocol.py
def test_on_receive_with_new_line_with_failed_decode(self):
self.mock.connection = Mock(spec=network.Connection)
self.mock.recv_buffer = ''
self.mock.parse_lines.return_value = [sentinel.line]
self.mock.decode.return_value = None
network.LineProtocol.on_receive(self.mock, {'received': 'data\n'})
self.assertEqual(0, self.mock.on_line_received.call_count)