Exemplo n.º 1
0
    def test_stop(self):
        '''
        Test parallels.stop
        '''
        name = 'macvm'
        runas = 'macdev'

        # Validate stop
        mock_stop = MagicMock()
        with patch.object(parallels, 'prlctl', mock_stop):
            parallels.stop(name, runas=runas)
            mock_stop.assert_called_once_with('stop', [name], runas=runas)

        # Validate immediate stop
        mock_kill = MagicMock()
        with patch.object(parallels, 'prlctl', mock_kill):
            parallels.stop(name, kill=True, runas=runas)
            mock_kill.assert_called_once_with('stop', [name, '--kill'], runas=runas)
Exemplo n.º 2
0
    def test_stop(self):
        """
        Test parallels.stop
        """
        name = "macvm"
        runas = "macdev"

        # Validate stop
        mock_stop = MagicMock()
        with patch.object(parallels, "prlctl", mock_stop):
            parallels.stop(name, runas=runas)
            mock_stop.assert_called_once_with("stop", [name], runas=runas)

        # Validate immediate stop
        mock_kill = MagicMock()
        with patch.object(parallels, "prlctl", mock_kill):
            parallels.stop(name, kill=True, runas=runas)
            mock_kill.assert_called_once_with("stop", [name, "--kill"], runas=runas)
Exemplo n.º 3
0
    def test_stop(self):
        '''
        Test parallels.stop
        '''
        name = 'macvm'
        runas = 'macdev'

        # Validate stop
        mock_stop = MagicMock()
        with patch.object(parallels, 'prlctl', mock_stop):
            parallels.stop(name, runas=runas)
            mock_stop.assert_called_once_with('stop', [name], runas=runas)

        # Validate immediate stop
        mock_kill = MagicMock()
        with patch.object(parallels, 'prlctl', mock_kill):
            parallels.stop(name, kill=True, runas=runas)
            mock_kill.assert_called_once_with('stop', [name, '--kill'], runas=runas)