# -*- coding: utf-8 -*-
'''
unit tests for the script engine
'''
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals

# Import Salt Testing Libs
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.unit import skipIf, TestCase
from tests.support.mock import (
    NO_MOCK,
    NO_MOCK_REASON,
    patch)

# Import Salt Libs
import salt.config
import salt.engines.script as script
from salt.exceptions import CommandExecutionError


@skipIf(NO_MOCK, NO_MOCK_REASON)
class EngineScriptTestCase(TestCase, LoaderModuleMockMixin):
    '''
    Test cases for salt.engine.script
    '''

    def setup_loader_modules(self):

        opts = salt.config.DEFAULT_MASTER_OPTS
        return {
            script: {
                '__opts__': opts
             }
        }

    def test__get_serializer(self):
        '''
        Test known serializer is returned or exception is raised
        if unknown serializer
        '''
        for serializers in ('json', 'yaml', 'msgpack'):
            self.assertTrue(script._get_serializer(serializers))

        with self.assertRaises(CommandExecutionError):
            script._get_serializer('bad')

    def test__read_stdout(self):
        '''
        Test we can yield stdout
        '''
        with patch('subprocess.Popen') as popen_mock:
            popen_mock.stdout.readline.return_value = 'test'
            self.assertEqual(next(script._read_stdout(popen_mock)), 'test')

@@ -269,16 +269,8 @@
 port
- skipIf,
  Tes
@@ -310,53 +310,13 @@
 ort 
-(%0A    NO_MOCK,%0A    NO_MOCK_REASON,%0A    
 patch
-)
 %0A%0A# 
@@ -444,41 +444,8 @@
 r%0A%0A%0A
-@skipIf(NO_MOCK, NO_MOCK_REASON)%0A
 clas

Fix linter