Esempio n. 1
0
def _file_url(path):
    """Return a file:// url (as string) for the given LocalPath.

    Arguments:
        path: The filepath as LocalPath (as handled by py.path)
    """
    return urlutils.file_url(str(path))
Esempio n. 2
0
def test_enter_folder_smoke(dir_layout, glimpseproc):
    glimpseproc.open_url(dir_layout.file_url())
    glimpseproc.send_cmd(':hint all normal')
    # a is the parent link, s is the first listed folder/file
    glimpseproc.send_cmd(':follow-hint s')
    expected_url = urlutils.file_url(dir_layout.path('folder0'))
    glimpseproc.wait_for_load_finished_url(expected_url)
    page = parse(glimpseproc)
    assert page.path == dir_layout.path('folder0')
Esempio n. 3
0
def test_enter_folder(dir_layout, glimpseproc, folder):
    glimpseproc.open_url(dir_layout.file_url())
    glimpseproc.click_element_by_text(text=folder)
    expected_url = urlutils.file_url(dir_layout.path(folder))
    glimpseproc.wait_for_load_finished_url(expected_url)
    page = parse(glimpseproc)
    assert page.path == dir_layout.path(folder)
    assert page.parent == dir_layout.path()
    folders, files = DirLayout.get_folder_content(folder)
    foldernames = [item.text for item in page.folders]
    assert foldernames == folders
    filenames = [item.text for item in page.files]
    assert filenames == files
Esempio n. 4
0
 def file_url(self):
     """Return a file:// link to the directory."""
     return urlutils.file_url(str(self.layout))
Esempio n. 5
0
def test_file_url():
    assert urlutils.file_url('/foo/bar') == 'file:///foo/bar'