Exemple #1
0
    def test_updateEndSparqlJob(self):
        jm = JobManager(self.settings, self.request.session)
        jobid = jm.saveStartSparqlJob("TypeBidon","{}")
        jm.updateEndSparqlJob(jobid,"Hello")
        l = jm.listJobs()
        assert len(l) == 1
        assert l[0]['state'] == "Hello"

        jm.updateEndSparqlJob(jobid,"Hello",nr=10)
        l = jm.listJobs()
        assert len(l) == 1
        assert l[0]['state'] == "Hello"
        assert l[0]['nr'] == 10

        jm.updateEndSparqlJob(jobid,"Hello",data={ "a" : "b" })
        l = jm.listJobs()
        assert len(l) == 1
        assert l[0]['state'] == "Hello"
        assert l[0]['data'] == { 'a' : 'b' }

        jm.updateEndSparqlJob(jobid,"Hello",file="test.tsv")
        l = jm.listJobs()
        assert len(l) == 1
        assert l[0]['state'] == "Hello"
        assert l[0]['file'] == "test.tsv"

        jm.updateEndSparqlJob(jobid,"Hello",file="test.tsv",data={'test': ['t1','t2']})
        l = jm.listJobs()
        assert len(l) == 1
        assert l[0]['state'] == "Hello"
        assert l[0]['file'] == "test.tsv"

        jm.removeJob(jobid)
Exemple #2
0
    def test_updateEndSparqlJob(self):
        jm = JobManager(self.settings, self.request.session)
        jobid = jm.saveStartSparqlJob("TypeBidon","{}")
        jm.updateEndSparqlJob(jobid,"Hello")
        l = jm.listJobs()
        assert len(l) == 1
        assert l[0]['state'] == "Hello"

        jm.updateEndSparqlJob(jobid,"Hello",nr=10)
        l = jm.listJobs()
        assert len(l) == 1
        assert l[0]['state'] == "Hello"
        assert l[0]['nr'] == 10

        jm.updateEndSparqlJob(jobid,"Hello",data={ "a" : "b" })
        l = jm.listJobs()
        assert len(l) == 1
        assert l[0]['state'] == "Hello"
        assert l[0]['data'] == { 'a' : 'b' }

        jm.updateEndSparqlJob(jobid,"Hello",file="test.tsv")
        l = jm.listJobs()
        assert len(l) == 1
        assert l[0]['state'] == "Hello"
        assert l[0]['file'] == "test.tsv"

        jm.removeJob(jobid)
Exemple #3
0
    def test_listJobs(self):
        import os

        jm = JobManager(self.settings, self.request.session)
        l = jm.listJobs()

        os.remove(jm.pathdb)
        try:
            l = jm.listJobs()
            assert False
        except Exception as e:
            assert True
Exemple #4
0
    def test_listJobs(self):
        import os

        jm = JobManager(self.settings, self.request.session)
        l = jm.listJobs()

        os.remove(jm.pathdb)
        try:
            l = jm.listJobs()
            assert False
        except Exception as e:
            assert True
Exemple #5
0
    def tes_listJobs(self):
        import os

        jm = JobManager(self.settings, self.request.session)
        os.remove(jm.pathdb)

        l = jm.listJobs()