def test_shorter_files_check(wind, ttorrent, dir2):
    'Test missing files checker proceduire.'
    (window, _) = wind
    checktab = window.central.checkWidget
    dirpath = Path(dir2)
    window.central.setCurrentWidget(checktab)

    def shortenfile(item):
        'Shave some data off the end of file.'
        temp = bytearray((2 ** 19))
        with open(item, 'rb') as fd:
            fd.readinto(temp)
        with open(item, 'wb') as fd:
            fd.write(temp)
    if os.path.exists(dirpath):
        for item in dirpath.iterdir():
            if item.is_file():
                shortenfile(item)
    checktab.fileInput.setText(ttorrent)
    checktab.searchInput.setText(dir2)
    checktab.checkButton.click()
    assert (checktab.treeWidget.topLevelItemCount() > 0)
Test missing files checker proceduire.
def test_shorter_files_check(wind, ttorrent, dir2):
    
    (window, _) = wind
    checktab = window.central.checkWidget
    dirpath = Path(dir2)
    window.central.setCurrentWidget(checktab)

    def shortenfile(item):
        'Shave some data off the end of file.'
        temp = bytearray((2 ** 19))
        with open(item, 'rb') as fd:
            fd.readinto(temp)
        with open(item, 'wb') as fd:
            fd.write(temp)
    if os.path.exists(dirpath):
        for item in dirpath.iterdir():
            if item.is_file():
                shortenfile(item)
    checktab.fileInput.setText(ttorrent)
    checktab.searchInput.setText(dir2)
    checktab.checkButton.click()
    assert (checktab.treeWidget.topLevelItemCount() > 0)