def test_no_call_signal_transferring_to_underlying_fileobj(self): underlying_stream = mock.Mock(io.RawIOBase) underlying_stream.tell.return_value = 0 chunk = ReadFileChunk(underlying_stream, 3, 3) try: chunk.signal_transferring() except AttributeError: self.fail( 'The stream should not have tried to call signal_transferring ' 'to the underlying stream.')
def test_signal_transferring_to_underlying_fileobj(self): underlying_stream = mock.Mock() underlying_stream.tell.return_value = 0 chunk = ReadFileChunk(underlying_stream, 3, 3) chunk.signal_transferring() self.assertTrue(underlying_stream.signal_transferring.called)