Example #1
0
    def test_process_intermediate(self):
        self.build.get_remote_status = lambda : 'building'

        result = obswatch.process_build(self.build)

        self.assertTrue(result)
        self.assertEqual(self.build.status, 'building')
Example #2
0
    def test_final_succeeded(self):
        self.build.get_remote_status = lambda : 'succeeded'

        mock('obswatch.Build.get_binaries', returns={'foo':'bar'})
        mock('obswatch.send_email', tracker=self.tt)
        result = obswatch.process_build(self.build)        
        self.assertFalse(result)

        expected_output = """Called obswatch.send_email(
                                 'geeko',
                                 '*****@*****.**',
                                 <obswatch.Build instance at ...>,
                                 {'foo': 'bar'})"""
        assert_same_trace(self.tt, expected_output)
Example #3
0
    def test_process_final_not_succeeded(self):
        self.build.get_remote_status = lambda : 'failed'
        result = obswatch.process_build(self.build)

        self.assertFalse(result)
Example #4
0
    def test_process_other(self):
        self.build.get_remote_status = lambda : 'excluded'
        result = obswatch.process_build(self.build)

        self.assertFalse(result)
Example #5
0
    def test_process_same_status(self):
        self.build.get_remote_status = lambda : self.build.status
        result = obswatch.process_build(self.build)

        self.assertTrue(result)