def test_return_all(self): io = IO(None) dr = DataReader(io) dr.lines = ["one\r\n", "two\r\n", ".\r\n", "three\r\n"] dr.EOD = 2 self.assertEqual("one\r\ntwo\r\n", dr.return_all()) self.assertEqual("three\r\n", io.recv_buffer)
def test_return_all(self): io = IO(None) dr = DataReader(io) dr.lines = [b'one\r\n', b'two\r\n', b'.\r\n', b'three\r\n'] dr.EOD = 2 self.assertEqual(b'one\r\ntwo\r\n', dr.return_all()) self.assertEqual(b'three\r\n', io.recv_buffer)
def test_return_all(self): io = IO(None) dr = DataReader(io) dr.lines = ['one\r\n', 'two\r\n', '.\r\n', 'three\r\n'] dr.EOD = 2 assert_equal('one\r\ntwo\r\n', dr.return_all()) assert_equal('three\r\n', io.recv_buffer)