1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/tests/unit/plugins/modules/cloud/docker/test_docker_container.py
Felix Fontein be191cce6c
Move modules and module_utils unit tests to correct place (#81)
* Move modules and module_utils unit tests to correct place.

* Update ignore.txt

* Fix imports.

* Fix typos.

* Fix more typos.
2020-03-31 10:42:38 +02:00

22 lines
808 B
Python

from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import unittest
from ansible_collections.community.general.plugins.modules.cloud.docker.docker_container import TaskParameters
class TestTaskParameters(unittest.TestCase):
"""Unit tests for TaskParameters."""
def test_parse_exposed_ports_tcp_udp(self):
"""
Ensure _parse_exposed_ports does not cancel ports with the same
number but different protocol.
"""
task_params = TaskParameters.__new__(TaskParameters)
task_params.exposed_ports = None
result = task_params._parse_exposed_ports([80, '443', '443/udp'])
self.assertTrue((80, 'tcp') in result)
self.assertTrue((443, 'tcp') in result)
self.assertTrue((443, 'udp') in result)