Example #1
0
    def test_run(self):
        """
        Build.run finishes immediately by default
        """
        b = Build()

        def cb(res):
            self.assertEqual(res, b)
            self.assertEqual(b.status, None)
        b.done.addCallback(cb)
        
        b.run()
        return b.done
Example #2
0
 def test_finish_1(self):
     """
     Finishing a build with non-zero means the build failed.
     """
     b = Build()
     
     def cb_done(res):
         self.assertEqual(res, b)
     b.done.addCallback(cb_done)
     
     b._finish(1)
     self.assertEqual(b.status, 1)
     
     return b.done
Example #3
0
 def test_finish_0(self):
     """
     Finishing a build with 0 means the build succeeded.
     """
     b = Build()
     
     def cb_done(res):
         self.assertEqual(res, b)
     b.done.addCallback(cb_done)
     
     b._finish(0)
     self.assertEqual(b.status, 0)
     
     return b.done
Example #4
0
 def test_toDict(self):
     """
     Should read all the required attributes.
     """
     b = Build()
     b.uid = 'something'
     b.status = 10
     b.project = 'project'
     b.version = 'version'
     b.test_path = 'foo/bar'
     b.runtime = 203
     self.assertEqual(b.toDict(), dict(
         uid='something', status=10, project='project',
         version='version', test_path='foo/bar', runtime=203))