Beispiel #1
0
 def test_read_with_peeled(self):
     f = StringIO('%s ref/1\n%s ref/2\n^%s\n%s ref/4' % (
       ONES, TWOS, THREES, FOURS))
     self.assertEqual([
       (ONES, 'ref/1', None),
       (TWOS, 'ref/2', THREES),
       (FOURS, 'ref/4', None),
       ], list(read_packed_refs_with_peeled(f)))
Beispiel #2
0
 def test_read_with_peeled(self):
     f = BytesIO(b'\n'.join([
         ONES + b' ref/1', TWOS + b' ref/2', b'^' + THREES,
         FOURS + b' ref/4'
     ]))
     self.assertEqual([
         (ONES, b'ref/1', None),
         (TWOS, b'ref/2', THREES),
         (FOURS, b'ref/4', None),
     ], list(read_packed_refs_with_peeled(f)))
Beispiel #3
0
 def test_read_with_peeled(self):
     f = BytesIO(b'\n'.join([
         ONES + b' ref/1',
         TWOS + b' ref/2',
         b'^' + THREES,
         FOURS + b' ref/4']))
     self.assertEqual([
         (ONES, b'ref/1', None),
         (TWOS, b'ref/2', THREES),
         (FOURS, b'ref/4', None),
         ], list(read_packed_refs_with_peeled(f)))
 def test_read_with_peeled(self):
     f = BytesIO(b"\n".join([
         ONES + b" ref/1",
         TWOS + b" ref/2",
         b"^" + THREES,
         FOURS + b" ref/4",
     ]))
     self.assertEqual(
         [
             (ONES, b"ref/1", None),
             (TWOS, b"ref/2", THREES),
             (FOURS, b"ref/4", None),
         ],
         list(read_packed_refs_with_peeled(f)),
     )
Beispiel #5
0
 def test_read_with_peeled(self):
     f = BytesIO(b"\n".join([ONES + b" ref/1", TWOS + b" ref/2", b"^" + THREES, FOURS + b" ref/4"]))
     self.assertEqual(
         [(ONES, b"ref/1", None), (TWOS, b"ref/2", THREES), (FOURS, b"ref/4", None)],
         list(read_packed_refs_with_peeled(f)),
     )