def test_make_machine_mapping_returns_correct_mapping(self):
    empty_mapping = utils.make_machine_mapping(None)
    self.assertTrue(type(empty_mapping) is dict)
    self.assertEqual(len(empty_mapping), 0)

    machine_list = ["host1=localhost", "host2=127.0.0.1"]
    machine_mapping = utils.make_machine_mapping(machine_list)
    self.assertEqual(len(machine_mapping), 2)
    self.assertEqual(machine_mapping["host2"], "127.0.0.1")

    self.assertRaises(ValueError, utils.make_machine_mapping,
                      ["host1==localhost"])
Tests if make_machine_mapping returns the correct mapping
dataset/ETHPy150Open linkedin/Zopkio/test/test_utils.py/TestUtils.test_make_machine_mapping_returns_correct_mapping