Ejemplo n.º 1
0
def test_ls_list_all_files_in_directory():
    res = ls(pj(tmp_dir, "tree"))
    assert len(res) == 2
    assert "doofus0.txt" in res
    assert "doofus1.txt" in res
Ejemplo n.º 2
0
def test_ls_do_not_list_directories():
    assert "subdir" not in ls(pj(tmp_dir, "tree"))
Ejemplo n.º 3
0
from sys import argv

from oaserver.oa_server_file import OAServerFile
from oaserver.uos import ls, remove

from ip_list import dirac_com_dir as com_dir


if len(argv) == 1:
    sid = "doofus"
else:
    port = int(argv[1])
    sid = "doofus_%d" % port

local_com_dir = com_dir + "/" + sid
stdin = "dirac:%s/stdin" % local_com_dir
stdout = "dirac:%s/stdout" % local_com_dir

for name in ls(stdin):
    remove(stdin + "/" + name)

####################################################################
#
#   launch oaserver
#
####################################################################
oas = OAServerFile(sid, stdin)
oas.register(stdout + "/reg.json")
oas.start()
Ejemplo n.º 4
0
def test_ls_raise_error_if_pth_is_not_a_directory():
    assert_raises(OSError, lambda: ls("takapouet"))
Ejemplo n.º 5
0
from oaserver.uos import ls

com_dir = "/vo.france-grilles.fr/user/j/jchopard"

print ls("dirac:%s" % com_dir)