Beispiel #1
0
 def test_find_last_single_muxed(self):
     page1 = OggPage()
     page1.last = True
     page2 = OggPage()
     page2.serial = page1.serial + 1
     pages = [page1, page2]
     data = BytesIO(b"".join([page.write() for page in pages]))
     assert OggPage.find_last(data, page2.serial).serial == page2.serial
Beispiel #2
0
 def test_find_last_single_muxed(self):
     page1 = OggPage()
     page1.last = True
     page2 = OggPage()
     page2.serial = page1.serial + 1
     pages = [page1, page2]
     data = BytesIO(b"".join([page.write() for page in pages]))
     assert OggPage.find_last(data, page2.serial).serial == page2.serial
Beispiel #3
0
    def test_find_last_none_finishing_mux(self):
        page1 = OggPage()
        page1.last = True
        page1.position = -1
        page2 = OggPage()
        page2.serial = page1.serial + 1
        pages = [page1, page2]
        data = BytesIO(b"".join([page.write() for page in pages]))

        assert OggPage.find_last(data, page1.serial, finishing=True) is None
        assert OggPage.find_last(data, page2.serial, finishing=True) == page2
Beispiel #4
0
    def test_find_last_none_finishing_mux(self):
        page1 = OggPage()
        page1.last = True
        page1.position = -1
        page2 = OggPage()
        page2.serial = page1.serial + 1
        pages = [page1, page2]
        data = BytesIO(b"".join([page.write() for page in pages]))

        assert OggPage.find_last(data, page1.serial, finishing=True) is None
        assert OggPage.find_last(data, page2.serial, finishing=True) == page2