Follow up patch to address reviewer comments on 241770

Corrects doc string and order of assert values in review 241770
(I02e79b635202a7933ae641b9d27cc19a75b7bc4f).

Change-Id: If2f99cbb4d330321531d541d92fccd9271f0feec
This commit is contained in:
Chris Krelle 2015-11-25 08:26:31 -08:00 committed by Ruby Loo
parent 8d878e6268
commit ce88b25c47

View File

@ -13,10 +13,10 @@
# under the License. # under the License.
""" """
test_bifrost test_inventory
---------------------------------- ----------------------------------
Tests for `bifrost` module. Tests for `inventory` module.
""" """
from bifrost import inventory from bifrost import inventory
@ -31,11 +31,11 @@ class TestBifrostInventory(base.TestCase):
self.assertIn("localhost", groups) self.assertIn("localhost", groups)
self.assertDictEqual(hostvars, {}) self.assertDictEqual(hostvars, {})
localhost_value = dict(hosts=["127.0.0.1"]) localhost_value = dict(hosts=["127.0.0.1"])
self.assertDictEqual(groups['localhost'], localhost_value) self.assertDictEqual(localhost_value, groups['localhost'])
def test__val_or_none(self): def test__val_or_none(self):
array = ['no', '', 'yes'] array = ['no', '', 'yes']
self.assertEqual(inventory._val_or_none(array, 0), 'no') self.assertEqual('no', inventory._val_or_none(array, 0))
self.assertEqual(inventory._val_or_none(array, 1), None) self.assertEqual(None, inventory._val_or_none(array, 1))
self.assertEqual(inventory._val_or_none(array, 2), 'yes') self.assertEqual('yes', inventory._val_or_none(array, 2))
self.assertEqual(inventory._val_or_none(array, 4), None) self.assertEqual(None, inventory._val_or_none(array, 4))