

@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):
    '\n        Tests true if the alias is set\n        '
    with patch('salt.utils.fopen', mock_open()):
        mock_opt = MagicMock(return_value=None)
        with patch.dict(hosts.__salt__, {
            'config.option': mock_opt,
        }):
            mock_opt.assertTrue(hosts.set_host('10.10.10.10', 'Salt1'))

dataset/ETHPy150Open saltstack/salt/tests/unit/modules/hosts_test.py HostsTestCase.test_set_host_true/VarMisuse@80/151 `self`->`mock_opt`