Esempio n. 1
0
    def test_highstate(self, get_sls_opts, get_file_client, SSHHighState,
                       _create_and_execute_salt_state):
        '''
        Test execution of Salt states in chroot.
        '''
        SSHHighState.return_value = SSHHighState

        _create_and_execute_salt_state.return_value = 'result'
        opts_mock = {
            'hash_type': 'md5',
        }
        get_sls_opts.return_value = opts_mock
        with patch.dict(chroot.__opts__, opts_mock):
            self.assertEqual(chroot.highstate('/chroot'), 'result')
            _create_and_execute_salt_state.assert_called_once()
Esempio n. 2
0
    def test_highstate(
        self,
        get_sls_opts,
        get_file_client,
        SSHHighState,
        _create_and_execute_salt_state,
    ):
        """
        Test execution of Salt states in chroot.
        """
        SSHHighState.return_value = SSHHighState

        _create_and_execute_salt_state.return_value = "result"
        opts_mock = {
            "hash_type": "md5",
        }
        get_sls_opts.return_value = opts_mock
        with patch.dict(chroot.__opts__, opts_mock):
            self.assertEqual(chroot.highstate("/chroot"), "result")
            _create_and_execute_salt_state.assert_called_once()