'Provide a function to get a parsed dirbrowser document.'

@pytest.fixture
def parser(self):

    def parse(path):
        html = filescheme.dirbrowser_html(path).decode('utf-8')
        soup = bs4.BeautifulSoup(html, 'html.parser')
        print soup.prettify()
        container = soup('div', id='dirbrowserContainer')[0]
        parent_elem = container('ul', class_='parent')
        if (not parent_elem):
            parent = None
        else:
            parent = parent_elem[0].li.a.string
        folders = []
        files = []
        for li in container('ul', class_='folders')[0]('li'):
            item = self.Item(link=li.a['href'], text=str(li.a.string))
            folders.append(item)
        for li in container('ul', class_='files')[0]('li'):
            item = self.Item(link=li.a['href'], text=str(li.a.string))
            files.append(item)
        return self.Parsed(parent=parent, folders=folders, files=files)
    return parse
