salimfadhley/jenkinsapi — pull request #171 by rocktavious (2013-09-28 15:38:50+00:00)
Title: Build.get_downstream_* methods with testcase

These methods do not return the proper data. Fixing them and adding a
unit test for them.

Currently i'm stuck(i haven't done much unittest writing in my time) and i'm not familar with magicmock so its having issues i cannot figure out.

So the issue is that a build objects .get_downstream_* method relies on the builds Job object to know about the downstreamProjects. Since in this test case senario, its a MagicMock object(which i'm not familar with) it doesn't get the proper data when called. IE:
build.job.get_downstream_job_names() returns nothing in the test case, but in a live test returns the proper stuff.

I have tested this code change on my live jenkins work server and all the methods return the proper data, but the test case is failing because of the MagicMock object.

As for the duration timeDelta object stuff thats working great, i've put in a test case for it in this pull request too.

If you can help me get over the MagicMock stuff that would be great! Then i can start to finish up the test for the .get_downstream_* methods