Example #1
0
    def test_info(self):
        '''
            Test getting the info about the current license key
        '''
        expected = {
            'description': 'Prof',
            'licensed': True,
            'name': 'Win7',
            'partial_key': '12345'
        }

        mock = MagicMock(return_value='Name: Win7\r\nDescription: Prof\r\nPartial Product Key: 12345\r\n'
                                      'License Status: Licensed')
        with patch.dict(win_license.__salt__, {'cmd.run': mock}):
            out = win_license.info()
            mock.assert_called_once_with(r'cscript C:\Windows\System32\slmgr.vbs /dli')
            self.assertEqual(out, expected)
Example #2
0
    def test_info(self):
        '''
            Test getting the info about the current license key
        '''
        expected = {
            'description': 'Prof',
            'licensed': True,
            'name': 'Win7',
            'partial_key': '12345'
        }

        mock = MagicMock(return_value='Name: Win7\r\nDescription: Prof\r\nPartial Product Key: 12345\r\n'
                                      'License Status: Licensed')
        with patch.dict(license.__salt__, {'cmd.run': mock}):
            out = license.info()
            mock.assert_called_once_with(r'cscript C:\Windows\System32\slmgr.vbs /dli')
            self.assertEqual(out, expected)
Example #3
0
    def test_info(self):
        """
        Test getting the info about the current license key
        """
        expected = {
            "description": "Prof",
            "licensed": True,
            "name": "Win7",
            "partial_key": "12345",
        }

        mock = MagicMock(return_value=(
            "Name: Win7\r\nDescription: Prof\r\nPartial Product Key: 12345\r\n"
            "License Status: Licensed"))
        with patch.dict(win_license.__salt__, {"cmd.run": mock}):
            out = win_license.info()
            mock.assert_called_once_with(
                r"cscript C:\Windows\System32\slmgr.vbs /dli")
            self.assertEqual(out, expected)