コード例 #1
0
 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)
コード例 #2
0
 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)
コード例 #3
0
 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)
コード例 #4
0
 def test_recv_piece_already_eod(self):
     dr = DataReader(None)
     dr.EOD = 2
     self.assertFalse(dr.recv_piece())