<commit_before># -*- coding: utf-8 -*-
"""
mac_power tests
"""

# Import python libs
from __future__ import absolute_import, print_function, unicode_literals

# Import Salt Libs
import salt.modules.mac_power as mac_power
from salt.exceptions import SaltInvocationError

# Import Salt Testing Libs
from tests.support.unit import TestCase


class MacPowerTestCase(TestCase):
    """
    test mac_power execution module
    """

    def test_validate_sleep_valid_number(self):
        """
        test _validate_sleep function with valid number
        """
        self.assertEqual(mac_power._validate_sleep(179), 179)

    def test_validate_sleep_invalid_number(self):
        """
        test _validate_sleep function with invalid number
        """
        self.assertRaises(SaltInvocationError, mac_power._validate_sleep, 181)

    def test_validate_sleep_valid_string(self):
        """<commit_msg>Drop Py2 and six on tests/unit/modules/test_mac_power.py<commit_after>"""
mac_power tests
"""

import salt.modules.mac_power as mac_power
from salt.exceptions import SaltInvocationError
from tests.support.unit import TestCase


class MacPowerTestCase(TestCase):
    """
    test mac_power execution module
    """

    def test_validate_sleep_valid_number(self):
        """
        test _validate_sleep function with valid number
        """
        self.assertEqual(mac_power._validate_sleep(179), 179)

    def test_validate_sleep_invalid_number(self):
        """
        test _validate_sleep function with invalid number
        """
        self.assertRaises(SaltInvocationError, mac_power._validate_sleep, 181)

    def test_validate_sleep_valid_string(self):
        """
{'fraction_non_alphanumeric': 0.08228980322003578, 'fraction_numerical': 0.011926058437686345, 'mean_word_length': 3.5972602739726027, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4652720', 'n_tokens_mistral': 489, 'n_tokens_neox': 460, 'n_words': 111}