Beispiel #1
0
    def test_installed_capabilities(self):
        '''
            Test getting all the installed capabilities
        '''
        capabilties = "Capability Identity : Capa1\r\n State : Installed\r\n" \
                      "Capability Identity : Capa2\r\n State : Disabled\r\n"

        mock = MagicMock(return_value=capabilties)
        with patch.dict(dism.__salt__, {'cmd.run': mock}):
            out = dism.installed_capabilities()
            mock.assert_called_once_with('DISM /Online /Get-Capabilities')
            self.assertEqual(out, ["Capa1"])
Beispiel #2
0
    def test_installed_capabilities(self):
        '''
            Test getting all the installed capabilities
        '''
        capabilties = "Capability Identity : Capa1\r\n State : Installed\r\n" \
                      "Capability Identity : Capa2\r\n State : Disabled\r\n"

        mock = MagicMock(return_value=capabilties)
        with patch.dict(dism.__salt__, {'cmd.run': mock}):
            out = dism.installed_capabilities()
            mock.assert_called_once_with('DISM /Online /Get-Capabilities')
            self.assertEqual(out, ["Capa1"])
Beispiel #3
0
def test_installed_capabilities():
    """
    Test getting all the installed capabilities
    """
    capabilties = ("Capability Identity : Capa1\r\n State : Installed\r\n"
                   "Capability Identity : Capa2\r\n State : Disabled\r\n")

    mock = MagicMock(return_value=capabilties)
    with patch.dict(dism.__salt__, {"cmd.run": mock}):
        with patch.dict(dism.__grains__, {"osversion": 10}):
            out = dism.installed_capabilities()
            mock.assert_called_once_with(
                [dism.bin_dism, "/English", "/Online", "/Get-Capabilities"])
            assert out == ["Capa1"]
Beispiel #4
0
    def test_installed_capabilities(self):
        '''
            Test getting all the installed capabilities
        '''
        capabilties = "Capability Identity : Capa1\r\n State : Installed\r\n" \
                      "Capability Identity : Capa2\r\n State : Disabled\r\n"

        mock = MagicMock(return_value=capabilties)
        with patch.dict(dism.__salt__, {'cmd.run': mock}):
            with patch.dict(dism.__grains__, {'osversion': 10}):
                out = dism.installed_capabilities()
                mock.assert_called_once_with([
                    dism.bin_dism, '/English', '/Online', '/Get-Capabilities'
                ])
                self.assertEqual(out, ["Capa1"])