@patch('salt.modules.hosts.__get_hosts_filename',
           MagicMock(return_value='/etc/hosts'))
    @patch('os.path.isfile', MagicMock(return_value=True))
    def test_set_host_true(self):
        with patch('salt.utils.fopen', mock_open()):
            mock_opt = MagicMock(return_value=None)
            with patch.dict(hosts.__salt__, {'config.option': mock_opt}):
                self.assertTrue(hosts.set_host('10.10.10.10', 'Salt1'))
Tests true if the alias is set
dataset/ETHPy150Open saltstack/salt/tests/unit/modules/hosts_test.py/HostsTestCase.test_set_host_true