Esempio n. 1
0
    def test_api_rebuilds(self):
        """ Verifies that after adding a failing test, build that passed build()
        now fails."""

        build = Build()
        build.status = 2
        build.save()

        response = self.client.post('/builds/new', data=dict(build_id=str(build._id)))

        api.worker.join()

        build.reload()

        self.assertEqual(build.status, 1)
        self.assertTrue(api.worker.current_build is None)
        self.assertEqual(response.json['id'], str(build._id))
Esempio n. 2
0
    def test_api_blame_list(self):
        """ Verifies that the data returned is the same as data stored"""

        for i in range(15):
            build = Build()
            build.status = 2
            if i < 5:
                build.author.name = 'jessepollak'
            elif i < 10:
                build.author.name = 'dunvi'
            else:
                build.author.name = 'brennenbyrne'

            build.save()

        response = self.client.get('/blame')

        self.assertEqual(response.json['brennenbyrne'], 5)
        self.assertEqual(response.json['jessepollak'], 5)
        self.assertEqual(response.json['dunvi'], 5)