
from bifrost import inventory

from bifrost.tests import base


class TestBifrostInventoryUnit(base.TestCase):

    def test_inventory_preparation(self):
        (groups, hostvars) = inventory._prepare_inventory()
        self.assertIn("baremetal", groups)
        self.assertIn("localhost", groups)
        self.assertDictEqual(hostvars, {})
        localhost_value = dict(hosts=["127.0.0.1"])
        self.assertDictEqual(localhost_value, groups['localhost'])

    def test__val_or_none(self):
        array = ['no', '', 'yes']
        self.assertEqual('no', inventory._val_or_none(array, 0))
        self.assertEqual(None, inventory._val_or_none(array, 1))
        self.assertEqual('yes', inventory._val_or_none(array, 2))
        self.assertEqual(None, inventory._val_or_none(array, 4))


from bifrost import inventory

from bifrost.tests import base


class TestBifrostInventoryUnit(base.TestCase):

    def test_inventory_preparation(self):
        (groups, hostvars) = inventory._prepare_inventory()
        self.assertIn("baremetal", groups)
        self.assertIn("localhost", groups)
        self.assertDictEqual(hostvars, {})
        localhost_value = dict(hosts=["127.0.0.1"])
        self.assertDictEqual(localhost_value, groups['localhost'])

    def test__val_or_none(self):
        array = ['no', '', 'yes']
        self.assertEqual('no', inventory._val_or_none(array, 0))
        self.assertIsNone(inventory._val_or_none(array, 1))
        self.assertEqual('yes', inventory._val_or_none(array, 2))
        self.assertIsNone(inventory._val_or_none(array, 4))

Replace assertEqual(None, *) with assertIsNone
Replace assertEqual(None, *) with assertIsNone

Replace assertEqual(None, *) with assertIsNone in tests

Change-Id: I257c479b7a23e39178d292c347d04ad979c48f0f
Closes-bug: #1280522

  
  from bifrost import inventory
  
  from bifrost.tests import base
  
  
  class TestBifrostInventoryUnit(base.TestCase):
  
      def test_inventory_preparation(self):
          (groups, hostvars) = inventory._prepare_inventory()
          self.assertIn("baremetal", groups)
          self.assertIn("localhost", groups)
          self.assertDictEqual(hostvars, {})
          localhost_value = dict(hosts=["127.0.0.1"])
          self.assertDictEqual(localhost_value, groups['localhost'])
  
      def test__val_or_none(self):
          array = ['no', '', 'yes']
          self.assertEqual('no', inventory._val_or_none(array, 0))
-         self.assertEqual(None, inventory._val_or_none(array, 1))
+         self.assertIsNone(inventory._val_or_none(array, 1))
          self.assertEqual('yes', inventory._val_or_none(array, 2))
-         self.assertEqual(None, inventory._val_or_none(array, 4))
+         self.assertIsNone(inventory._val_or_none(array, 4))
  
Replace assertEqual(None, *) with assertIsNone
## Code Before:

from bifrost import inventory

from bifrost.tests import base


class TestBifrostInventoryUnit(base.TestCase):

    def test_inventory_preparation(self):
        (groups, hostvars) = inventory._prepare_inventory()
        self.assertIn("baremetal", groups)
        self.assertIn("localhost", groups)
        self.assertDictEqual(hostvars, {})
        localhost_value = dict(hosts=["127.0.0.1"])
        self.assertDictEqual(localhost_value, groups['localhost'])

    def test__val_or_none(self):
        array = ['no', '', 'yes']
        self.assertEqual('no', inventory._val_or_none(array, 0))
        self.assertEqual(None, inventory._val_or_none(array, 1))
        self.assertEqual('yes', inventory._val_or_none(array, 2))
        self.assertEqual(None, inventory._val_or_none(array, 4))

## Instruction:
Replace assertEqual(None, *) with assertIsNone
## Code After:

from bifrost import inventory

from bifrost.tests import base


class TestBifrostInventoryUnit(base.TestCase):

    def test_inventory_preparation(self):
        (groups, hostvars) = inventory._prepare_inventory()
        self.assertIn("baremetal", groups)
        self.assertIn("localhost", groups)
        self.assertDictEqual(hostvars, {})
        localhost_value = dict(hosts=["127.0.0.1"])
        self.assertDictEqual(localhost_value, groups['localhost'])

    def test__val_or_none(self):
        array = ['no', '', 'yes']
        self.assertEqual('no', inventory._val_or_none(array, 0))
        self.assertIsNone(inventory._val_or_none(array, 1))
        self.assertEqual('yes', inventory._val_or_none(array, 2))
        self.assertIsNone(inventory._val_or_none(array, 4))
