Merge "Remove dead code"

This commit is contained in:
Zuul 2019-04-05 13:58:59 +00:00 committed by Gerrit Code Review
commit 8c223e95c2
2 changed files with 0 additions and 21 deletions

View File

@ -310,13 +310,6 @@ class ProviderSummary(object):
self.resources = resources or []
self.traits = traits or []
@property
def resource_class_names(self):
"""Helper property that returns a set() of resource class string names
that are included in the provider summary.
"""
return set(res.resource_class for res in self.resources)
class ProviderSummaryResource(object):

View File

@ -11,7 +11,6 @@
# under the License.
import mock
import os_resource_classes as orc
from placement.objects import allocation_candidate
from placement.tests.unit.objects import base
@ -46,16 +45,3 @@ class TestAllocationCandidatesNoDB(base.TestCase):
self.context, aro_in, sum_in, 2)
self.assertEqual(aro_in[:2], aro)
self.assertEqual(set([sum1, sum0, sum4, sum8, sum5]), set(sum))
class TestProviderSummaryNoDB(base.TestCase):
def test_resource_class_names(self):
psum = allocation_candidate.ProviderSummary(mock.sentinel.ctx)
disk_psr = allocation_candidate.ProviderSummaryResource(
resource_class=orc.DISK_GB, capacity=100, used=0)
ram_psr = allocation_candidate.ProviderSummaryResource(
resource_class=orc.MEMORY_MB, capacity=1024, used=0)
psum.resources = [disk_psr, ram_psr]
expected = set(['DISK_GB', 'MEMORY_MB'])
self.assertEqual(expected, psum.resource_class_names)