def test_installed_feature(self):
        expected = {
            'comment': "Feat1 was already installed.\n",
            'changes': {},
            'name': 'Feat1',
            'result': True
        }

        installed_mock = MagicMock(return_value=["Feat1", "Feat2"])
        install_mock = MagicMock()
        with patch.dict(dism.__salt__, {'dism.installed_features': installed_mock,
                                        'dism.install_feature': install_mock}):
            out = dism.feature_installed('Feat1', 'somewhere', True)
            installed_mock.assert_called_once_with()
            assert not install_mock.called
            self.assertEqual(out, expected)
Test installing a feature already installed
dataset/ETHPy150Open saltstack/salt/tests/unit/states/win_dism_test.py/DISMTestCase.test_installed_feature