Exemplo n.º 1
0
def test_get_capabilities():
    """
    Test getting all the 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.get_capabilities()
            mock.assert_called_once_with(
                [dism.bin_dism, "/English", "/Online", "/Get-Capabilities"])
            assert out == ["Capa1", "Capa2"]
Exemplo n.º 2
0
    def test_get_capabilities(self):
        '''
            Test getting all the 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.get_capabilities()
                mock.assert_called_once_with(
                    ['DISM', '/English', '/Online', '/Get-Capabilities'])
                self.assertEqual(out, ['Capa1', 'Capa2'])
Exemplo n.º 3
0
    def test_get_capabilities(self):
        '''
            Test getting all the 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.get_capabilities()
                mock.assert_called_once_with(
                    ['DISM', '/English', '/Online', '/Get-Capabilities'])
                self.assertEqual(out, ['Capa1', 'Capa2'])