def test_directory(self): from Ganga.GPI import jobtree, Job jobtree.cd() assert(jobtree.pwd() == '/') jobtree.mkdir('testdir') # it is OK to mkdir an existing directory jobtree.mkdir('testdir') assert('testdir' in jobtree.ls()['folders']) jobtree.cd('testdir') assert(jobtree.pwd() == '/testdir') j = Job() jobtree.add(j) assert(str(j.id) in jobtree.ls()['jobs']) assert(str(j.id) in jobtree.ls('/testdir')['jobs']) jobtree.cd('..') assert(jobtree.pwd() == '/') assert(str(j.id) in jobtree.ls('/testdir')['jobs']) assert(str(j.id) not in jobtree.ls()['jobs']) jobtree.rm('/*')
def test_directory(self): from Ganga.GPI import jobtree, Job jobtree.cd() assert (jobtree.pwd() == '/') jobtree.mkdir('testdir') # it is OK to mkdir an existing directory jobtree.mkdir('testdir') assert ('testdir' in jobtree.ls()['folders']) jobtree.cd('testdir') assert (jobtree.pwd() == '/testdir') j = Job() jobtree.add(j) assert (str(j.id) in jobtree.ls()['jobs']) assert (str(j.id) in jobtree.ls('/testdir')['jobs']) jobtree.cd('..') assert (jobtree.pwd() == '/') assert (str(j.id) in jobtree.ls('/testdir')['jobs']) assert (str(j.id) not in jobtree.ls()['jobs']) jobtree.rm('/*')
def test_addremove(self): from Ganga.GPI import jobtree, Job jobtree.cd() # make sure the job is really added j = Job() jobtree.add(j) assert (str(j.id) in jobtree.ls()['jobs']) # make sure the addition is not automatic j2 = Job() assert (not str(j2.id) in jobtree.ls()['jobs']) try: jobtree.rm(j2.id) except TreeError as x: pass # make sure the job may be deleted jobtree.rm(j.id) jobtree.rm('/*')
def test_addremove(self): from Ganga.GPI import jobtree, Job jobtree.cd() # make sure the job is really added j = Job() jobtree.add(j) assert(str(j.id) in jobtree.ls()['jobs']) # make sure the addition is not automatic j2 = Job() assert(not str(j2.id) in jobtree.ls()['jobs']) try: jobtree.rm(j2.id) except TreeError as x: pass # make sure the job may be deleted jobtree.rm(j.id) jobtree.rm('/*')