示例#1
0
 def test_multiple_reads(self):
     f = _LengthLimitedFile(StringIO('foobar'), 3)
     self.assertEquals('fo', f.read(2))
     self.assertEquals('o', f.read(2))
     self.assertEquals('', f.read())
 def test_multiple_reads(self):
     f = _LengthLimitedFile(BytesIO(b'foobar'), 3)
     self.assertEqual(b'fo', f.read(2))
     self.assertEqual(b'o', f.read(2))
     self.assertEqual(b'', f.read())
示例#3
0
 def test_cutoff(self):
     f = _LengthLimitedFile(StringIO('foobar'), 3)
     self.assertEquals('foo', f.read())
     self.assertEquals('', f.read())
示例#4
0
文件: test_web.py 项目: big-p/dulwich
 def test_no_cutoff(self):
     f = _LengthLimitedFile(StringIO('foobar'), 1024)
     self.assertEqual('foobar', f.read())
 def test_cutoff(self):
     f = _LengthLimitedFile(BytesIO(b'foobar'), 3)
     self.assertEqual(b'foo', f.read())
     self.assertEqual(b'', f.read())
示例#6
0
 def test_cutoff(self):
     f = _LengthLimitedFile(StringIO('foobar'), 3)
     self.assertEquals('foo', f.read())
     self.assertEquals('', f.read())
示例#7
0
 def test_multiple_reads(self):
     f = _LengthLimitedFile(StringIO('foobar'), 3)
     self.assertEquals('fo', f.read(2))
     self.assertEquals('o', f.read(2))
     self.assertEquals('', f.read())
示例#8
0
 def test_multiple_reads(self):
     f = _LengthLimitedFile(BytesIO(b'foobar'), 3)
     self.assertEqual(b'fo', f.read(2))
     self.assertEqual(b'o', f.read(2))
     self.assertEqual(b'', f.read())
示例#9
0
 def test_no_cutoff(self):
     f = _LengthLimitedFile(StringIO('foobar'), 1024)
     self.assertEqual('foobar', f.read())
示例#10
0
 def test_cutoff(self):
     f = _LengthLimitedFile(BytesIO(b'foobar'), 3)
     self.assertEqual(b'foo', f.read())
     self.assertEqual(b'', f.read())
示例#11
0
 def test_multiple_reads(self):
     f = _LengthLimitedFile(BytesIO(b"foobar"), 3)
     self.assertEqual(b"fo", f.read(2))
     self.assertEqual(b"o", f.read(2))
     self.assertEqual(b"", f.read())
示例#12
0
 def test_cutoff(self):
     f = _LengthLimitedFile(BytesIO(b"foobar"), 3)
     self.assertEqual(b"foo", f.read())
     self.assertEqual(b"", f.read())
示例#13
0
 def test_multiple_reads(self):
     f = _LengthLimitedFile(StringIO("foobar"), 3)
     self.assertEquals("fo", f.read(2))
     self.assertEquals("o", f.read(2))
     self.assertEquals("", f.read())
示例#14
0
 def test_cutoff(self):
     f = _LengthLimitedFile(StringIO("foobar"), 3)
     self.assertEquals("foo", f.read())
     self.assertEquals("", f.read())