def test_installed_feature(self): ''' Test getting all the installed capabilities ''' capabilties = "Feature Name : Capa1\r\n State : Enabled\r\n" \ "Feature Name : Capa2\r\n State : Disabled\r\n" mock = MagicMock(return_value=capabilties) with patch.dict(dism.__salt__, {'cmd.run': mock}): out = dism.installed_features() mock.assert_called_once_with('DISM /Online /Get-Features') self.assertEqual(out, ["Capa1"])
def test_installed_features(): """ Test getting all the installed features """ features = ("Feature Name : Capa1\r\n State : Enabled\r\n" "Feature Name : Capa2\r\n State : Disabled\r\n") mock = MagicMock(return_value=features) with patch.dict(dism.__salt__, {"cmd.run": mock}): out = dism.installed_features() mock.assert_called_once_with( [dism.bin_dism, "/English", "/Online", "/Get-Features"]) assert out == ["Capa1"]
def test_installed_features(self): ''' Test getting all the installed features ''' features = "Feature Name : Capa1\r\n State : Enabled\r\n" \ "Feature Name : Capa2\r\n State : Disabled\r\n" mock = MagicMock(return_value=features) with patch.dict(dism.__salt__, {'cmd.run': mock}): out = dism.installed_features() mock.assert_called_once_with( [dism.bin_dism, '/English', '/Online', '/Get-Features']) self.assertEqual(out, ["Capa1"])