Thank you very much for writing such thorough tests. Overall this looks good.
My main suggestion is to try to factor out common code (e.g. in to separate methods or functions). Benefits include:
- If you find a bug you only have to fix it in one place
- It usually makes your intent clearer by highlight important differences.
Please make sure every method (and class and free function) has a doc string explaining what it is doing. Most of your test methods are missing this.
I am nervous about using assertEqual to compare numeric values that should be the same. Unless you have a very strong reason to expect floats to be identical I recommend that you use assertAlmostEqual instead, with a suitable tolerance.
Also, this is picky, but please provide a space after the leading "#" in Python comments. It makes them easier to read.
A few specific bits:
testApCorrMapKeys: I don't think it is safe to assume an order for the keys (though I may be wrong). If order is not assured then this is safer: self.assertEqual(set(struct.apCorrMap.keys()), set(key_names))
testTooFewSources: I don't understand what this test is doing (though a method doc string would probably explain). And it's testing zero sources, which is a stretch for the term "too few".
testSourceNotUsed: I think this test would be more believable if the source you add had data associated with it (including a centroid that is presumably outside the bbox).
testApertureMeasOnes and testApertureMeasTens are one instance of similar code that could be factored out into common code.
Please run pyflakes and fix the warnings, including an imported package that is not used and setting variables that are not used. In some cases a line can be deleted; in others perhaps you want to call a function to be sure it doesn't raise an exception, in which case don't assign the returned result to a variable.
testFailureFlagged, testSuccessUnflagged, testCatFluxUnchanged and testCatFluxSigma share a lot of common code (especially the first two).
I have a small concern that by constructing the task in setUp, you discourage tests from constructing the task with a different configuration.