Пример #1
0
 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'
         ])
Пример #2
0
 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'
         ])
Пример #3
0
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",
        ])
Пример #4
0
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",
        ])