示例#1
0
    def setUp(self):
        segments = [(ByteIStream(b"*******abcde**************"), 7, 5),
                    (ByteIStream(b"******fghi****************"), 6, 4),
                    (ByteIStream(b"jklmn*********************"), 0, 5),
                    (ByteIStream(b"*****************opqrstuvw"), 17, 9),
                    (ByteIStream(b"*******************xy*****"), 19, 2),
                    (ByteIStream(b"z"), 0, 1)]

        self.composite = Composite(segments)
示例#2
0
    def setUp(self):
        segments = [
            (ByteIStream(b"*******abcde**************"), 7, 5),
            (ByteIStream(b"******fghi****************"), 6, 4),
            (ByteIStream(b"jklmn*********************"), 0, 5),
            (ByteIStream(b"*****************opqrstuvw"), 17, 9),
            (ByteIStream(b"*******************xy*****"), 19, 2),
            (ByteIStream(b"z"), 0, 1)
        ]

        self.composite = Composite(segments)
示例#3
0
class CompositeTestCase(TestCase):
    def setUp(self):
        segments = [
            (ByteIStream(b"*******abcde**************"), 7, 5),
            (ByteIStream(b"******fghi****************"), 6, 4),
            (ByteIStream(b"jklmn*********************"), 0, 5),
            (ByteIStream(b"*****************opqrstuvw"), 17, 9),
            (ByteIStream(b"*******************xy*****"), 19, 2),
            (ByteIStream(b"z"), 0, 1)
        ]

        self.composite = Composite(segments)
    # end def setUp

    def test_list(self):
        ae = self.assertEqual
        ae(self.composite.list(), [StreamInfo(0)])
    # end def test_list

    def test_open(self):
        ae = self.assertEqual
        ae(self.composite.open(), self.composite.stream)
示例#4
0
class CompositeTestCase(TestCase):
    def setUp(self):
        segments = [(ByteIStream(b"*******abcde**************"), 7, 5),
                    (ByteIStream(b"******fghi****************"), 6, 4),
                    (ByteIStream(b"jklmn*********************"), 0, 5),
                    (ByteIStream(b"*****************opqrstuvw"), 17, 9),
                    (ByteIStream(b"*******************xy*****"), 19, 2),
                    (ByteIStream(b"z"), 0, 1)]

        self.composite = Composite(segments)

    # end def setUp

    def test_list(self):
        ae = self.assertEqual
        ae(self.composite.list(), [StreamInfo(0)])

    # end def test_list

    def test_open(self):
        ae = self.assertEqual
        ae(self.composite.open(), self.composite.stream)