def test_add_feature(self): ''' Test installing a feature with DISM ''' mock = MagicMock() with patch.dict(dism.__salt__, {'cmd.run_all': mock}): dism.add_feature("test") mock.assert_called_once_with([ 'DISM', '/Quiet', '/Online', '/Enable-Feature', '/FeatureName:test', '/NoRestart' ])
def test_add_feature_with_extras(self): ''' Test installing a feature with DISM ''' mock = MagicMock() with patch.dict(dism.__salt__, {'cmd.run_all': mock}): dism.add_feature('sponge', 'bob', 'C:\\temp', True, True) mock.assert_called_once_with([ 'DISM', '/Quiet', '/Online', '/Enable-Feature', '/FeatureName:sponge', '/PackageName:bob', '/Source:C:\\temp', '/LimitAccess', '/All', '/NoRestart' ])
def test_add_feature(): """ Test installing a feature with DISM """ mock = MagicMock() with patch.dict(dism.__salt__, {"cmd.run_all": mock}): dism.add_feature("test") mock.assert_called_once_with([ dism.bin_dism, "/Quiet", "/Online", "/Enable-Feature", "/FeatureName:test", "/NoRestart", ])
def test_add_feature_with_extras(): """ Test installing a feature with DISM """ mock = MagicMock() with patch.dict(dism.__salt__, {"cmd.run_all": mock}): dism.add_feature("sponge", "bob", "C:\\temp", True, True) mock.assert_called_once_with([ dism.bin_dism, "/Quiet", "/Online", "/Enable-Feature", "/FeatureName:sponge", "/PackageName:bob", "/Source:C:\\temp", "/LimitAccess", "/All", "/NoRestart", ])