Esempio n. 1
0
    def test_job_get(self):
        expected = self.job_names[0]
        actual = db_api.job_get('', self.job_ids[0]).name

        self.assertEquals(expected, actual)

        self.assertRaises(exception.NotFound, db_api.job_get, '', 9001)
Esempio n. 2
0
    def test_job_get(self):
        expected = self.job_names[0]
        actual = db_api.job_get('', self.job_ids[0]).name

        self.assertEquals(expected, actual)

        self.assertRaises(exception.NotFound, db_api.job_get, '', 9001)
Esempio n. 3
0
    def test_job_create(self):
        id = 1
        while (self.job_ids.count(id) > 0):
            id = id + 1
        job_tmp = db_api.job_create('', u'job_{0}'.format(id), id)
        self.job_ids.append(id)
        self.job_names.append(u'job_{0}'.format(id))

        actual = db_api.job_get('', id)
        self.assertIsNotNone(actual)
Esempio n. 4
0
    def test_job_create(self):
        id = 1
        while (self.job_ids.count(id) > 0):
            id = id + 1
        job_tmp = db_api.job_create('', u'job_{0}'.format(id), id)
        self.job_ids.append(id)
        self.job_names.append(u'job_{0}'.format(id))

        actual = db_api.job_get('', id)
        self.assertIsNotNone(actual)
Esempio n. 5
0
    def test_job_update(self):
        db_api.job_update('', 1, dict(owner='OwnerTest', state=states.CLAIMED))
        job = db_api.job_get('', 1)

        expected = 'OwnerTest'
        actual = job.owner

        self.assertEquals(expected, actual)

        expected = states.CLAIMED
        actual = job.state

        self.assertEquals(expected, actual)

        self.assertRaises(exception.NotFound, db_api.job_update, '', 9001,
                          dict(owner='OwnerTest', state=states.CLAIMED))
Esempio n. 6
0
    def test_job_update(self):
        db_api.job_update('', 1, dict(owner='OwnerTest', state=states.CLAIMED))
        job = db_api.job_get('', 1)

        expected = 'OwnerTest'
        actual = job.owner

        self.assertEquals(expected, actual)

        expected = states.CLAIMED
        actual = job.state

        self.assertEquals(expected, actual)

        self.assertRaises(exception.NotFound, db_api.job_update, '', 9001,
                          dict(owner='OwnerTest', state=states.CLAIMED))