mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
c57b5a5502
This fixes breakage introduced in https://github.com/saltstack/salt/pull/45406 and adds a unit test.
23 lines
601 B
Python
23 lines
601 B
Python
# -*- coding: utf-8 -*-
|
|
'''
|
|
Tests for salt.utils.iam
|
|
'''
|
|
# Import Python libs
|
|
from __future__ import absolute_import, print_function, unicode_literals
|
|
|
|
import salt.utils.iam as iam
|
|
from salt.ext import six
|
|
from tests.support.unit import TestCase, skipIf
|
|
|
|
|
|
class IamTestCase(TestCase):
|
|
|
|
@skipIf(six.PY3, 'Only needs to run on Python 2')
|
|
def test__convert_key_to_str(self):
|
|
'''
|
|
Makes sure that unicode string is converted to a str type on PY2
|
|
'''
|
|
key = 'foo'
|
|
expected = key.encode('utf-8')
|
|
self.assertEqual(iam._convert_key_to_str(key), expected)
|