mirror of https://github.com/ansible/ansible.git
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.
20 lines
681 B
Python
20 lines
681 B
Python
7 years ago
|
import unittest
|
||
|
|
||
|
from ansible.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)
|