Add missing unit test for goodness weigher
Add a unit test for goodness weigher to test unset goodness function in host capabilities. Change-Id: I67f86d065f2c740a7beef641250b0881cf63deaa
This commit is contained in:
parent
102f6cfff2
commit
5a948407ce
|
@ -24,6 +24,19 @@ class GoodnessWeigherTestCase(test.TestCase):
|
|||
def setUp(self):
|
||||
super(GoodnessWeigherTestCase, self).setUp()
|
||||
|
||||
def test_goodness_weigher_with_no_goodness_function(self):
|
||||
weigher = goodness.GoodnessWeigher()
|
||||
host_state = fakes.FakeHostState('host1', {
|
||||
'host': 'host.example.com',
|
||||
'capabilities': {
|
||||
'foo': '50'
|
||||
}
|
||||
})
|
||||
|
||||
weight_properties = {}
|
||||
weight = weigher._weigh_object(host_state, weight_properties)
|
||||
self.assertEqual(0, weight)
|
||||
|
||||
def test_goodness_weigher_passing_host(self):
|
||||
weigher = goodness.GoodnessWeigher()
|
||||
host_state = fakes.FakeHostState('host1', {
|
||||
|
|
Loading…
Reference in New Issue