

@patch('os.path.isfile', MagicMock(return_value=False))
def test_add_host_no_file(self):
    '\n        Tests if specified host entry gets added from the hosts file\n        '
    with patch('salt.utils.fopen', mock_open()):
        mock_opt = MagicMock(return_value=None)
        with patch.dict(hosts.__salt__, {
            'config.option': mock_opt,
        }):
            self.assertFalse(hosts.add_host('10.10.10.10', 'Salt1'))

dataset/ETHPy150Open saltstack/salt/tests/unit/modules/hosts_test.py HostsTestCase.test_add_host_no_file/original