Пример #1
0
def test_ls_accept_trailing_slashes():
    url = urlsplit("test/toto")
    elms1 = ls(url)
    url = urlsplit("test/toto/")
    elms2 = ls(url)

    assert set(elms1) == set(elms2)
Пример #2
0
def test_ls_list_all_elms_in_dir():
    url = urlsplit("test/toto")
    elms = ls(url)
    assert len(elms) == 2
    assert ("test/toto/sub", True) in elms
    assert ("test/toto/doofus.txt", False) in elms

    url = urlsplit("test/toto/sub")
    elms = ls(url)
    assert len(elms) == 2
    assert ("test/toto/sub/doofus.txt", False) in elms
    assert ("test/toto/sub/subdoofus.txt", False) in elms
Пример #3
0
def test_ls_raise_error_if_pth_not_exists():
    url = urlsplit("takapouet")
    assert_raises(URLError, lambda: ls(url))
Пример #4
0
def test_ls_do_not_list_subdirs():
    url = urlsplit("test/toto")
    elms = ls(url)
    assert ("test/toto/sub/doofus.txt", False) not in elms
    assert ("test/toto/sub/subdoofus.txt", False) not in elms