You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/test/units/modules/cloud/amazon/test_ec2_utils.py

13 lines
546 B
Python

import unittest
from ansible.module_utils.ec2 import map_complex_type
class Ec2Utils(unittest.TestCase):
def test_map_complex_type_over_dict(self):
complex_type = {'minimum_healthy_percent': "75", 'maximum_percent': "150"}
type_map = {'minimum_healthy_percent': 'int', 'maximum_percent': 'int'}
complex_type_mapped = map_complex_type(complex_type, type_map)
complex_type_expected = {'minimum_healthy_percent': 75, 'maximum_percent': 150}
self.assertEqual(complex_type_mapped, complex_type_expected)