Exemplo n.º 1
0
def test_remove_raise_error_if_pth_is_dir():
    assert_raises(OSError, lambda: remove(pj(tmp_dir, "tree/subdir")))
Exemplo n.º 2
0
def test_remove_actually_remove_file():
    pth = pj(tmp_dir, "tree", "doofus0.txt")
    assert os.path.exists(pth)
    remove(pth)
    assert not os.path.exists(pth)
Exemplo n.º 3
0
def test_remove_raise_error_if_file_do_not_exists():
    assert_raises(OSError, lambda: remove("tutu.titi"))
Exemplo n.º 4
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()