907a2cbecd
This patch reduces the complexity of AllocationCandidates._get_by_requests by factoring out the piece that applies a limit to the results. In the process of inspecting this code, I noticed what I thought was a bug, so I wrote a test to uncover it. Turns out there was no bug; but I kept the test case (and the "fix" for the bug - a slight refactor and optimization of the limiting algorithm) because it provides heretofore-absent coverage. (Since allocation requests are returned in nondeterministic order, it would be nearly impossible to write a functional test to ensure that the provider summaries are always trimmed correctly.) Change-Id: I80f8b1a74b8afdabbb85afc6caef1abef8ac3751 |
||
---|---|---|
.. | ||
__init__.py | ||
test_resource_provider.py |