@patch('salt.modules.hosts._list_hosts',
           MagicMock(return_value={'10.10.10.10': ['Salt1', 'Salt2']}))
    def test_list_hosts(self):
        self.assertDictEqual({'10.10.10.10': ['Salt1', 'Salt2']},
                             hosts.list_hosts())

    # 'get_ip' function tests: 3
Tests return the hosts found in the hosts file
dataset/ETHPy150Open saltstack/salt/tests/unit/modules/hosts_test.py/HostsTestCase.test_list_hosts